Skip to content

Instantly share code, notes, and snippets.

@friedmud
Created June 2, 2018 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save friedmud/fc12e37974b2d3c5ebdf9a428d235beb to your computer and use it in GitHub Desktop.
Save friedmud/fc12e37974b2d3c5ebdf9a428d235beb to your computer and use it in GitHub Desktop.
#include <iostream>
#include <tuple>
template <class... Ts>
void acceptsTuple(std::tuple<Ts...> values)
{
std::cout << std::get<0>(values) << std::get<1>(values);
}
template <class... Ts>
class AcceptsTuple
{
public:
void acceptsTuple(std::tuple<Ts...> values)
{
std::cout << std::get<0>(values) << std::get<1>(values);
}
};
int main()
{
acceptsTuple<std::string, double>({"stuff", 1.2});
AcceptsTuple<std::string, double> at;
at.acceptsTuple({"stuff", 1.2});
}
@friedmud
Copy link
Author

friedmud commented Jun 2, 2018

Also works fine with the newest intel compiler available on Falcon: icc/2018.1.163-GCC-6.4.0-2.28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment