Advertisement
Guest User

Untitled

a guest
Apr 9th, 2012
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <boost/variant.hpp>
  2.  
  3. class b_fwd;
  4.  
  5. typedef
  6.     boost::variant
  7.     <
  8.         boost::recursive_wrapper<b_fwd>
  9.     >
  10.     a
  11. ;
  12.  
  13.  
  14.  
  15. class c_fwd;
  16.  
  17. typedef
  18.     boost::variant
  19.     <
  20.         boost::recursive_wrapper<c_fwd>
  21.     >
  22.     b
  23. ;
  24. struct b_fwd: b
  25. {
  26.     //inherit constructors
  27.     template<typename... Ts>
  28.     b_fwd(Ts... o): b(o...){}
  29. };
  30.  
  31.  
  32.  
  33. typedef
  34.     boost::variant
  35.     <
  36.         double,
  37.         char*
  38.     >
  39.     c
  40. ;
  41. struct c_fwd: c
  42. {
  43.     //inherit constructors
  44.     template<typename... Ts>
  45.     c_fwd(Ts... o): c(o...){}
  46. };
  47.  
  48.  
  49.  
  50. void
  51. f(const b& b_node)
  52. {
  53.     a a_node(b_node);
  54. }
  55.  
  56.  
  57.  
  58. int main()
  59. {
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement