void Questions

2

I intend for my question to be a follow up to: How do we use void_t for SFINAE?. I understand how void_t is used. I do not understand why it is necessary. Let's take the example from that SO questi...
Apicella asked 6/10 at 17:50

1

Solved

A requires-expression can introduce local parameters using a parameter list. If any of these parameters has void type, will the requires expression just yield false or shall it be hard compilation ...
Northeastwards asked 19/9 at 20:32

7

I am not sure what this means, whenever before you write a code, people say this public static void main(String[] args) { What does that mean?
Futurity asked 26/3, 2015 at 11:9

6

Solved

I was testing return types with PHP 7. I've created a simple script to test return types of PHP 7: <?php Class Obj { public function __construct(){ } public function test(): string { //...
Gravedigger asked 22/4, 2015 at 9:12

4

Why would someone write: function () { if (err) { return void console.log(err) } } instead of: function () { if (err) { console.log(err) return } } Has anyone used the void operator at...
Branching asked 5/6, 2017 at 6:16

4

Solved

The description of std::is_void states that: Provides the member constant value that is equal to true, if T is the type void, const void, volatile void, or const volatile void. Then what could be...
Metameric asked 17/6, 2016 at 12:9

10

Solved

I have a method that looks like this: private async void DoStuff(long idToLookUp) { IOrder order = await orderService.LookUpIdAsync(idToLookUp); // Close the search IsSearchShowing = false; }...
Overcapitalize asked 7/1, 2013 at 22:57

8

Solved

Consider the following snippet: void Foo() { // ... } void Bar() { return Foo(); } What is a legitimate reason to use the above in C++ as opposed to the more common approach: void Foo() { /...
Chervil asked 8/8, 2010 at 15:15

5

Solved

I want to write a function with pl/pgsql. I'm using PostgresEnterprise Manager v3 and using shell to make a function, but in the shell I must define return type. If I don't define the return type,...
Bread asked 8/1, 2013 at 14:9

7

Solved

Is it possible to have an array of multiple types by using malloc? EDIT: Currently I have: #include <stdio.h> #include <stdlib.h> #include <string.h> #define int(x) *((int *) x...
Tenpins asked 17/10, 2011 at 19:14

3

Solved

This is a follow-up up of Differences between decltype(void()) and decltype(void{}). In the comments and in the answer it is said more than once that void{} is neither a valid type-id nor a valid e...
Personalism asked 6/9, 2016 at 16:46

8

Solved

How can I wait for an async void method to finish its job? For example, I have a function like below: async void LoadBlahBlah() { await blah(); //... } Now I want to make sure that everything ha...
Haemostat asked 29/11, 2012 at 23:25

4

Solved

In which situation should we prefer a void pointer over a char pointer or vice-versa? As a matter of fact both can be type cast to any of the data types.
Anzus asked 26/12, 2018 at 12:29

1

Solved

If I am not mistaken, it is allowed to write return void() in function templates to avoid unnecessary specializations and overloads for void type. At the same time, a similar syntax return vo...
Literator asked 20/6, 2023 at 19:10

8

Solved

I'm looking at a path finding tutorial and I noticed a return statement inside a void method (class PathTest, line 126): if ((x < 0) || (y < 0) || (x >= map.getWidthInTiles()) || (y >=...
Latten asked 13/4, 2009 at 17:27

5

Solved

I have a few static util methods in my project, some of them just pass or throw an exception. There are a lot of examples out there on how to mock a static method that has a return type other than ...
Hooker asked 6/3, 2012 at 14:12

9

Solved

I have to return to the previous level of the recursion. is the syntax like below right? void f() { // some code here // return; }
Dilantin asked 12/2, 2010 at 1:39

2

Solved

namespace SubscriptionWebsite.PlaceHolders { public class TreeData { public int ID { get; set; } public int? ParentLocationID { get; set; } public string name { get; set; } public int? Locat...
Mnemonic asked 8/6, 2016 at 8:30

15

Solved

Looking to get the fundamentals on where the term "void" comes from, and why it is called void. The intention of the question is to assist someone who has no C experience, and is suddenly looking a...
Unkempt asked 25/6, 2009 at 10:4

3

Solved

I understand that void returns no values. So how does it work in conjuncture to a function? My understanding is that the purpose of a function is to return a piece of information after doing...
Winifred asked 14/11, 2016 at 6:26

2

Solved

I'm using Jest and Typescript. I have a async function that returns nothing (void). How do I mock returning void? I tried the below const myMockFn = jest.fn().mockImplementationOnce(() => Promis...
Cule asked 29/6, 2021 at 17:21

1

Solved

I am trying to add a column in my dataframe df1 in PySpark. The code I tried: import pyspark.sql.functions as F df1 = df1.withColumn("empty_column", F.lit(None)) But I get this error: p...
Bloxberg asked 18/10, 2022 at 18:36

1

Solved

I'm trying to write a function that measures the time of execution of other functions. It should have the same return type as the measured function. The problem is that i'm getting a compiler error...
Surround asked 3/9, 2022 at 23:11

10

Solved

Let's say I have the following functional interface in Java 8: interface Action<T, U> { U execute(T t); } And for some cases I need an action without arguments or return type. So I write ...
Featherhead asked 29/4, 2015 at 13:44

14

Solved

I haven't found anything with the specific needs of my function to do this, yes, it is for homework. So I have: public void reverseArray(int[] x) { } Precondition: x.length > 0 The fact that ...
Unending asked 31/10, 2012 at 1:44

© 2022 - 2024 — McMap. All rights reserved.