Advertisement
Guest User

Untitled

a guest
Jan 24th, 2014
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.67 KB | None | 0 0
  1. --- old-mainline/divine/toolkit/list.h  2014-01-24 20:56:57.305866248 +0100
  2. +++ new-mainline/divine/toolkit/list.h  2014-01-24 20:56:57.307866288 +0100
  3. @@ -17,7 +17,9 @@ template< int N > struct ConsAt;
  4.  template<>
  5.  struct ConsAt< 0 > {
  6.      template< typename Cons >
  7. -    static constexpr auto get( Cons &c ) -> decltype( c.car ) {
  8. +    using T = typename Cons::Car;
  9. +    template< typename Cons >
  10. +    static constexpr T< Cons > get( Cons &c ) {
  11.          return c.car;
  12.      }
  13.  };
  14. @@ -25,7 +27,9 @@ struct ConsAt< 0 > {
  15.  template< int N >
  16.  struct ConsAt {
  17.      template< typename Cons >
  18. -    static constexpr auto get( Cons &c ) -> decltype( ConsAt< N - 1 >::get( c.cdr ) )
  19. +    using T = typename ConsAt< N - 1 >::template T< typename Cons::Cdr >;
  20. +    template< typename Cons >
  21. +    static constexpr T< Cons > get( Cons &c )
  22.      {
  23.          return ConsAt< N - 1 >::get( c.cdr );
  24.      }
  25. @@ -84,7 +88,7 @@ constexpr auto concat( L1 l1, L2 l2 ) ->
  26.  }
  27.  
  28.  template< int I, typename Cons >
  29. -auto decons( Cons c ) -> decltype( ConsAt< I >::get( c ) )
  30. +auto decons( Cons c ) -> typename list::ConsAt< I >::template T< Cons > &
  31.  {
  32.      return c.template get< I >();
  33.  }
  34.  
  35. --- old-mainline/divine/llvm/execution.h    2014-01-24 20:56:57.306866268 +0100
  36. +++ new-mainline/divine/llvm/execution.h    2014-01-24 20:56:57.307866288 +0100
  37. @@ -69,7 +69,7 @@ template< typename X >
  38.  struct UnPtr< X * > { typedef X T; };
  39.  
  40.  template< int I, typename Cons >
  41. -auto deconsptr( Cons c ) -> typename UnPtr< decltype( list::ConsAt< I >::get( c ) ) >::T &
  42. +auto deconsptr( Cons c ) -> typename UnPtr< typename list::ConsAt< I >::template T< Cons > >::T &
  43.  {
  44.      return *c.template get< I >();
  45.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement