Questions tagged [inline-variable]

21 questions
1
vote
1 answer

postgres - inline variable assignment from select

In SQL Server it's possible to do inline variable assignment. For example, table dbo.tblSynonym: +--+-------+-----------+ |id|keyword|replacement| +--+-------+-----------+ |1 |aaa |bbb | |2 |xxx |yyy | |3 |ddd |eee …
NirKa
  • 697
  • 1
  • 7
  • 10
1
vote
2 answers

Defining global constexpr variables in anonymous namespace the same as making them inline?

Following up on Why does cppreference define type_traits xxx_v shortcuts as inline constexpr and not just constexpr?, if I make my own type trait and want to avoid ODR violations and want it to be compatible with pre-C++17 projects, is putting the…
Danra
  • 9,546
  • 5
  • 59
  • 117
0
votes
1 answer

inline static constexpr vs global inline constexpr

Suppose that I have a few inline constexpr variables (named as default_y and default_x) in a header file and I decided to move them to a class that they are completely related to and mark them static (cause it seems better in terms of…
digito_evo
  • 3,216
  • 2
  • 14
  • 42
0
votes
0 answers

Inline variables in loops

What happens if inline variables are used inside a loop: for i := 1 to N do begin for var j := 1 to M do begin { Do something with i and j } end; end; The scope of the variable j is only the inner loop. Does this mean that the…
Matej
  • 442
  • 3
  • 9
0
votes
1 answer

In total.js is it possible to assign value to variables or save/use the index of a @{foreach...} inside a nested @{foreach...} inline in the HTML?

for example is it possible to define/use an "item_index" in a similar example to this:
@{foreach item in list}

@{item.title}:

@{foreach content in item.contents}

@{content.name} is the @{index}th content of @{item.title}, and…

Garen
  • 30
  • 3
0
votes
0 answers

Any specific reason for variable templates in the standard library be inline?

C++17 introduced various helper variable templates, e.g., template< class T, class U > inline constexpr bool is_same_v = is_same::value; template< class T > inline constexpr bool is_aggregate_v = is_aggregate::value; They are all marked…
Lingxi
  • 14,579
  • 2
  • 37
  • 93
1
2