Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

All Questions

3 votes
1 answer
144 views

My program changed its behavior after updating Visual Studio to the latest version (2026). Simplifying it, I got the following minimal example, which contains a ternary operator with a throw in ...
Fedor's user avatar
  • 24.8k
1 vote
3 answers
110 views

How to add multiple children based on single ternary operator in Flutter Row? Row( children: [ Widget1(), n.type != null ? { Icon( Icons.access_time, size: 14, ...
Pulkit Goyal's user avatar
0 votes
1 answer
46 views

I have a DynamoDB table defined as follows: Partition key: id (string) Sort key: ruleId (string) Example item: { "id": "123", "ruleId": "abc" } What I want is ...
Maayan Israel's user avatar
5 votes
0 answers
176 views

According to this article by Raymond Chen, ternary expression is not a copy elision candidate. The problem with the ternary is that the ternary expression is not a copy elision candidate. The rule ...
許恩嘉's user avatar
  • 1,311
14 votes
1 answer
815 views

According to cppreference, value category of conditional operator in C++ depends on categories of the operands, namely: if both operands are lvalues, then conditional operator is also lvalue, ...
TDjey's user avatar
  • 165
1 vote
1 answer
223 views

This code gives me compiler error: "expected an expression". std::array< std::string, 3 > candidates = useOutname ? { "%O.log", "%O_.log", "_%O.log" } : { ...
PkDrew's user avatar
  • 2,301
0 votes
1 answer
67 views

I'm perplexed by the vscode hover hints and tsc (v5.8.3) messages I am seeing as I initialize a variable with a ternary expression that might return my trivial custom class. They seem to incorrectly ...
user3624334's user avatar
5 votes
2 answers
193 views

This statement mimics a ternary operator in the Lua programing language: local result = condition and true_value or false_value But how does it work? Why does it give true_value if the condition is ...
0747's user avatar
  • 55
4 votes
1 answer
116 views

I am using Java 8 and facing some weird error. The compiler gives the following error: error: reference to [method] is ambiguous Here's my code StringBuilder sb = new StringBuilder(); Stack<...
bloop's user avatar
  • 43
0 votes
1 answer
287 views

I'm using nunjucks as a templating engine in my application and can't seem to get the block to display at all when I apply more than two conditions e.g. {{ "true" if foo else "false&...
Haggishunt56's user avatar
0 votes
1 answer
92 views

My requirement is simple, I need to select the rows from a Pandas DataFrame when one of two couple columns are populated or both. The attributes contain integer foreign keys. This works: ...
KBD's user avatar
  • 141
1 vote
1 answer
87 views

I checked python operator precedence (This one grammar is more detailed and more appropriate for the actual Python implementation) Operators in the same box group left to right (except for ...
An5Drama's user avatar
  • 774
1 vote
0 answers
107 views

This example: struct X {}; struct Y : X {}; using CY = const Y; true ? X() : CY(); // error Which is explained in this answer, could be changed like this: struct X { operator int() { return 0; } }; ...
Sneed Deens's user avatar
3 votes
0 answers
72 views

This is a follow-up of this question: conditional operator expression with base and const derived class doesn't compile, why?. The core is cond ? [cv] T1() : [cv] T2() where, for instance T2 ...
Oersted's user avatar
  • 3,855
0 votes
2 answers
744 views

I can't understand what does the perl substitution return after applied. I have the following snippet my $w = "-foo"; my $v = $w =~ s/-//?0:1; print "---- $v\n"; If $w is -foo,...
smith's user avatar
  • 311

15 30 50 per page
1
2 3 4 5
258