Created
June 10, 2015 05:19
-
-
Save zaltoprofen/0d0ba37376d68a0cd8c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <utility> | |
#include <tuple> | |
#include <typeinfo> | |
template<typename, template<typename...>class> | |
struct repack { | |
}; | |
template<template<typename...> class Source, template<typename...> class Dest, typename ...Ts> | |
struct repack<Source<Ts...>, Dest> { | |
using type = Dest<Ts...>; | |
}; | |
int main(int argc, char const* argv[]) | |
{ | |
using x = std::pair<int, double>; | |
using y = repack<x, std::tuple>::type; | |
y z; | |
std::cout << typeid(z).name() << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment