pack fold [removed]c++17 extension) available when building with c++14

后端 未结 2 486
孤街浪徒
孤街浪徒 2020-12-21 08:56

The following code contains a fold expression, which afaiu is a c++17 feature:

template  static bool variable_length_or(const T ... v) {         


        
2条回答
  •  北海茫月
    2020-12-21 09:42

    If you don't add something as -ansi -pedantic, to impose a strict conformance to the standard, the compilers are free to adopt some extensions or, in this case, elements of the following standard.

    -ansi -pedantic are the options I add for g++ and clang++; other compilers can use different options, obviously.

    -- EDIT --

    As pointed by Barry (thanks!), -ansi is no more useful and is enough -pedantic.

    As pointed by Passer By (thanks!), can be useful the use of -pedantic-error to impose an error, and non only a warning, in case of not strictly conformance.

提交回复
热议问题