Order of evaluation of elements in list-initialization

前端 未结 1 1359
生来不讨喜
生来不讨喜 2020-11-27 06:20

In the other topic, @Dietmar gave this solution:

template 
std::tuple parse(std::istream& in) 
{
    return std::tuple&l         


        
相关标签:
1条回答
  • 2020-11-27 07:09

    Answering my own question. Deleting the question would not be a good idea, as someone might have the same question in the future.

    Yes. It is a bug in the GCC compiler.

    • Bug 51253 - [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list

    taken from @Johannes Schaub's comment to the question.

    0 讨论(0)
提交回复
热议问题