Thursday, September 29, 2016

C++ 17 on Compiler Explorer

http://gcc.godbolt.org/
Clang support C++17 more feature than gcc 6.9


//Clang 3.9.0 compiler option -std=c++11

#include <tuple>

using namespace std;

int test1()
{
  return 99;
}

std::tuple<int,int> test()
{
 return make_tuple<int>(1,2); 
}

int main()
{
  // const auto [s1,s2]=test(); // structured binding not working
  if( const auto i=test1();i==1) { //if-init works
  }
    return 0;
}

No comments:

Post a Comment