Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. enum some_enum {R, G, B};
  2.  
  3. typedef std::pair<some_enum, some_enum> Enum_Pair;
  4. typedef std::vector<some_enum> Enum_list;
  5. typedef std::pair<Enum_Pair, Enum_list> Some_Struct;
  6. typedef std::list<Some_Struct> Full_Struct;
  7.  
  8. #define MAKEFULLSTRUCT(First_, Second_, some_enums)
  9. (Some_Struct(Enum_Pair(First_, Second_), list_of (some_enums) ))
  10.  
  11. int main()
  12. {
  13. int i = G;
  14. Full_Struct test_struct = list_of
  15. MAKEFULLSTRUCT(R, R, R).to_container(test_struct);
  16. }
  17.  
  18. error C2668: 'std::vector<_Ty>::vector' : ambiguous call to overloaded function
  19. with [_Ty=some_enum]
  20. vector(593): could be 'std::vector<_Ty>::vector(std::vector<_Ty> &&)'
  21. with [ _Ty=some_enum]
  22. vector(515): or 'std::vector<_Ty>::vector(unsigned int)'
  23. with [ _Ty=some_enum]
  24. while trying to match the argument list '(boost::assign_detail::generic_list<T>)'
  25. with [ T=some_enum ]
  26.  
  27. #define MAKEFULLSTRUCT(First_, Second_, some_enums)
  28. (Some_Struct(Enum_Pair(First_, Second_),
  29. list_of(some_enums).convert_to_container<Enum_list>()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement