fork download
  1. #include <tuple>
  2. #include <memory>
  3.  
  4.  
  5. template<typename Type>
  6. struct identity {
  7.  
  8. using type = Type;
  9. };
  10.  
  11. template<typename...>
  12. struct holder {};
  13.  
  14. template<typename ...Types>
  15. struct holder<std::tuple<identity<Types>...>> {
  16. };
  17.  
  18.  
  19. struct abstract {
  20.  
  21. virtual ~abstract() = 0;
  22. };
  23.  
  24. abstract::~abstract() {}
  25.  
  26.  
  27. int main() {
  28. using types = std::tuple<identity<abstract>>;
  29. using holder_t = holder<types>;
  30.  
  31. // Ok
  32. holder_t local;
  33.  
  34. // Ok
  35. new holder_t;
  36.  
  37. // ?
  38. std::unique_ptr<holder_t> unique(new holder_t);
  39.  
  40. // ?
  41. std::make_shared<holder_t>();
  42. }
  43.  
Success #stdin #stdout 0s 2980KB
stdin
Standard input is empty
stdout
Standard output is empty