Skip to main content

Questions tagged [unions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5 votes
2 answers

Why does C not support direct array assignment?

In C you cannot assign arrays directly. int array[4] = {1, 2, 3, 4}; int array_prime[4] = array; // Error At first I thought this might because the C facilities were supposed to be implementable with ...
CPlus's user avatar
  • 1,189
1 vote
1 answer

Is using lambdas and overload resolution a recommended way to write a visitor for a variant?

If I have a discriminated union and want to write a function piecewise, the following code works just fine, but is taking advantage of some fairly tricky (at least to me) stuff involving overload ...
Daniel McLaury's user avatar
0 votes
1 answer

How are discriminated unions (e.g. in TS) used in messaging schemes?

In the documentation about discriminated unions in typescript, here it says: Discriminated unions are useful for more than just talking about circles and squares. They’re good for representing any ...
Bahaa's user avatar
  • 137
11 votes
3 answers

Naming of union and intersection types in TypeScript

In TypeScript, the following is called a union type: number | string and this is called an intersection type: number & string However, is the resulting type of the | not actually an intersection,...
P Varga's user avatar
  • 329
1 vote
4 answers

is stored procedure having multiple UNION efficient than running all SQL's in parallel?

I have below in my stored proc if then SELECT TABLE1.COLUMN1,TABLE1.COLUMN2,TABLE1.COLUMN3,TABLE1.COLUMN4 FROM TABLE1,TABLE2 where criteria1 (covers functionality 1) UNION SELECT TABLE1....
Vipin's user avatar
  • 141
0 votes
0 answers

Stable, Hash Based Symmetrical Difference

A lot of thought went into the implementation of the set algorithms in LINQ: Distinct, Except, Intersect and Union. They guarantee that the items are returned in the same order that they appear in ...
Travis Parks's user avatar
  • 2,533
3 votes
3 answers

Is there any merit to using `union` to create an alias?

I've inherited a bit of code and saw something new. They have a data structure definition out in a .h file, and in various local files they'll declare: union globalStructOstuff localVar; Is there ...
Philip's user avatar
  • 6,762
14 votes
8 answers

Are you a member of a trade union? [closed]

Are you a member of a trade union? Why? Why not? If you are, and don't mind mentioning it, which one? Do you know of any programmers who were helped by being in a union, or would have been helped by ...
Scott's user avatar
  • 2,091
55 votes
10 answers

Are there any unions for software developers? [closed]

Why does Software Engineering not have union representation like other professional occupations, such as teaching? Are there any unions for software developers that exist and are successful?
Engineer2021's user avatar
  • 3,228