#include <iostream>
#include <tuple>
struct MyClass
{
  MyClass(int a, int b, int c)
  {
    std::cout << a << " " << b << " " << c << std::endl;
  }
};
int main()
{ 
  MyClass myObject = std::make_from_tuple<MyClass>(
                                       std::make_tuple(1, 2, 3));
  
  return 0;
}
// Output: 1 2 3
References:http://en.cppreference.com/w/cpp/utility/make_from_tuple
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0209r2.pdf

No comments:
Post a Comment