$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r81683 - in trunk: boost/tti boost/tti/detail libs/tti/test
From: eldiener_at_[hidden]
Date: 2012-12-03 00:13:46
Author: eldiener
Date: 2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
New Revision: 81683
URL: http://svn.boost.org/trac/boost/changeset/81683
Log:
Changes to has type functionality.
Added:
   trunk/boost/tti/detail/dlambda.hpp   (contents, props changed)
   trunk/boost/tti/detail/dplaceholder.hpp   (contents, props changed)
Text files modified: 
   trunk/boost/tti/detail/dmetafunc.hpp             |     3                                         
   trunk/boost/tti/detail/dtype.hpp                 |    41 ++----------                            
   trunk/boost/tti/has_type.hpp                     |   126 +++++++++++++-------------------------- 
   trunk/libs/tti/test/test_has_type_ct.cpp         |    21 +++--                                   
   trunk/libs/tti/test/test_has_type_ct_compile.cpp |    23 ++++---                                 
   trunk/libs/tti/test/test_has_type_ct_fail.cpp    |     5 +                                       
   trunk/libs/tti/test/test_has_type_ct_fail2.cpp   |     5 +                                       
   trunk/libs/tti/test/test_has_type_ct_fail3.cpp   |     5 +                                       
   trunk/libs/tti/test/test_has_type_ct_fail4.cpp   |     5 +                                       
   trunk/libs/tti/test/test_has_type_ct_fail5.cpp   |     5 +                                       
   10 files changed, 96 insertions(+), 143 deletions(-)
Added: trunk/boost/tti/detail/dlambda.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/tti/detail/dlambda.hpp	2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
@@ -0,0 +1,34 @@
+
+//  (C) Copyright Edward Diener 2012
+//  Use, modification and distribution are subject to the Boost Software License,
+//  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt).
+
+#if !defined(BOOST_TTI_DETAIL_LAMBDA_HPP)
+#define BOOST_TTI_DETAIL_LAMBDA_HPP
+
+#include <boost/mpl/or.hpp>
+#include <boost/tti/detail/dmetafunc.hpp>
+#include <boost/tti/detail/dplaceholder.hpp>
+#include <boost/tti/gen/namespace_gen.hpp>
+
+namespace boost
+  {
+  namespace tti
+    {
+    namespace detail
+      {
+      template <class TTI_T>
+      struct is_lambda_expression :
+        boost::mpl::or_
+          <
+          BOOST_TTI_NAMESPACE::detail::is_metafunction_class<TTI_T>,
+          BOOST_TTI_NAMESPACE::detail::is_placeholder_expression<TTI_T>
+          >
+        {
+        };
+      }
+    }
+  }
+  
+#endif // BOOST_TTI_DETAIL_LAMBDA_HPP
Modified: trunk/boost/tti/detail/dmetafunc.hpp
==============================================================================
--- trunk/boost/tti/detail/dmetafunc.hpp	(original)
+++ trunk/boost/tti/detail/dmetafunc.hpp	2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
@@ -8,6 +8,7 @@
 #define BOOST_TTI_DETAIL_METAFUNC_HPP
 
 #include <boost/mpl/has_xxx.hpp>
+#include <boost/tti/gen/namespace_gen.hpp>
 
 namespace boost
   {
@@ -18,7 +19,7 @@
       BOOST_MPL_HAS_XXX_TEMPLATE_NAMED_DEF(is_metafunction_class_apply, apply, false)
       template <class TTI_T>
       struct is_metafunction_class :
-        boost::tti::detail::is_metafunction_class_apply<TTI_T>
+        BOOST_TTI_NAMESPACE::detail::is_metafunction_class_apply<TTI_T>
         {
         };
       }
Added: trunk/boost/tti/detail/dplaceholder.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/tti/detail/dplaceholder.hpp	2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
@@ -0,0 +1,36 @@
+
+//  (C) Copyright Edward Diener 2012
+//  Use, modification and distribution are subject to the Boost Software License,
+//  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt).
+
+#if !defined(BOOST_TTI_DETAIL_PLACEHOLDER_HPP)
+#define BOOST_TTI_DETAIL_PLACEHOLDER_HPP
+
+#include <boost/mpl/lambda.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+namespace boost
+  {
+  namespace tti
+    {
+    namespace detail
+      {
+      template <class TTI_T>
+      struct is_placeholder_expression :
+        boost::mpl::not_
+          <
+          boost::is_same
+            <
+            typename boost::mpl::lambda<TTI_T>::type,
+            TTI_T
+            >
+          >
+        {
+        };
+      }
+    }
+  }
+  
+#endif // BOOST_TTI_DETAIL_PLACEHOLDER_HPP
Modified: trunk/boost/tti/detail/dtype.hpp
==============================================================================
--- trunk/boost/tti/detail/dtype.hpp	(original)
+++ trunk/boost/tti/detail/dtype.hpp	2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
@@ -8,25 +8,13 @@
 #define BOOST_TTI_DETAIL_TYPE_HPP
 
 #include <boost/config.hpp>
-#include <boost/mpl/and.hpp>
 #include <boost/mpl/apply.hpp>
 #include <boost/mpl/bool.hpp>
-#include <boost/mpl/eval_if.hpp>
 #include <boost/mpl/has_xxx.hpp>
-#include <boost/mpl/not.hpp>
 #include <boost/preprocessor/cat.hpp>
 #include <boost/tti/detail/ddeftype.hpp>
-#include <boost/tti/detail/dmetafunc.hpp>
+#include <boost/tti/detail/dlambda.hpp>
 #include <boost/tti/gen/namespace_gen.hpp>
-#include <boost/type_traits/is_same.hpp>
-
-#define BOOST_TTI_DETAIL_TRAIT_IS_SAME_HAS_TYPE(trait,name) \
-template<class TTI_T,class TTI_U> \
-struct BOOST_PP_CAT(trait,_detail_type_is_same) : \
-  boost::is_same<typename TTI_T::name,TTI_U> \
-  { \
-  }; \
-/**/
 
 #define BOOST_TTI_DETAIL_TRAIT_INVOKE_HAS_TYPE(trait,name) \
 template<class TTI_T,class TTI_MFC> \
@@ -38,37 +26,24 @@
 
 #define BOOST_TTI_DETAIL_TRAIT_HAS_TYPE(trait,name) \
 BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(BOOST_PP_CAT(trait,_detail_type_mpl), name, false) \
-BOOST_TTI_DETAIL_TRAIT_IS_SAME_HAS_TYPE(trait,name) \
 BOOST_TTI_DETAIL_TRAIT_INVOKE_HAS_TYPE(trait,name) \
-template<class TTI_T,class TTI_U,class TTI_NOINV,class TTI_B> \
+template<class TTI_T,class TTI_U,class TTI_B> \
 struct BOOST_PP_CAT(trait,_detail_type) \
   { \
-  typedef typename \
-    boost::mpl::eval_if \
-      < \
-      boost::mpl::and_ \
-        < \
-        boost::mpl::not_ \
-          < \
-          TTI_NOINV \
-          >, \
-        typename BOOST_TTI_NAMESPACE::detail::is_metafunction_class<TTI_U>::type \
-        >, \
-      BOOST_PP_CAT(trait,_detail_type_invoke)<TTI_T,TTI_U>, \
-      BOOST_PP_CAT(trait,_detail_type_is_same)<TTI_T,TTI_U> \
-      >::type type; \
+  BOOST_MPL_ASSERT((BOOST_TTI_NAMESPACE::detail::is_lambda_expression<TTI_U>)); \
+  typedef typename BOOST_PP_CAT(trait,_detail_type_invoke)<TTI_T,TTI_U>::type type; \
   BOOST_STATIC_CONSTANT(bool,value=type::value); \
   }; \
 \
-template<class TTI_T,class TTI_U,class TTI_NOINV> \
-struct BOOST_PP_CAT(trait,_detail_type)<TTI_T,TTI_U,TTI_NOINV,boost::mpl::false_::type> \
+template<class TTI_T,class TTI_U> \
+struct BOOST_PP_CAT(trait,_detail_type)<TTI_T,TTI_U,boost::mpl::false_::type> \
   { \
   typedef boost::mpl::false_::type type; \
   BOOST_STATIC_CONSTANT(bool,value=type::value); \
   }; \
 \
-template<class TTI_T,class TTI_NOINV> \
-struct BOOST_PP_CAT(trait,_detail_type)<TTI_T,BOOST_TTI_NAMESPACE::detail::deftype,TTI_NOINV,boost::mpl::true_::type> \
+template<class TTI_T> \
+struct BOOST_PP_CAT(trait,_detail_type)<TTI_T,BOOST_TTI_NAMESPACE::detail::deftype,boost::mpl::true_::type> \
   { \
   typedef boost::mpl::true_::type type; \
   BOOST_STATIC_CONSTANT(bool,value=type::value); \
Modified: trunk/boost/tti/has_type.hpp
==============================================================================
--- trunk/boost/tti/has_type.hpp	(original)
+++ trunk/boost/tti/has_type.hpp	2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
@@ -27,8 +27,8 @@
 
     BOOST_TTI_TRAIT_HAS_TYPE is a macro which expands to a metafunction.
     The metafunction tests whether an inner type with a particular name exists
-    and, optionally, whether a second type is the same type as the inner type
-    or whether a lambda expression invoked with the inner type is true or not.
+    and, optionally, whether a lambda expression invoked with the inner type 
+    is true or not.
     
     trait = the name of the metafunction within the tti namespace.
     
@@ -36,7 +36,7 @@
 
     generates a metafunction called "trait" where 'trait' is the macro parameter.
     
-              template<class TTI_T,class TTI_U,class TTI_B>
+              template<class TTI_T,class TTI_U>
               struct trait
                 {
                 static const value = unspecified;
@@ -47,44 +47,23 @@
     
                 TTI_T = the enclosing type in which to look for our 'name'.
                 
-                TTI_U = (optional) An optional template parameter, defaulting to a marker type.. 
-                                   If specified it is a type which is one of two possibilities.
+                TTI_U = (optional) An optional template parameter, defaulting to a marker type.
+                                   If specified it is an MPL lambda expression which is invoked 
+                                   with the inner type found and must return a constant boolean 
+                                   value.
                                    
-                                   1) A type, which if specified, is checked to be the same as
-                                      the inner type found.
-                                      
-                                   2) An MPL lambda expression which is invoked with the inner 
-                                      type found and must return a constant boolean value.
-                                      
-                TTI_B = (optional) An optional template parameter of type boost::mpl::bool_,
-                                   defaulting to boost::mpl::false_.
-                                   
-                                   If TTI_U is an MPL lambda expression, whose type is meant to 
-                                   be checked to be the same as the inner type, rather than be 
-                                   invoked by the inner type, this parameter shoud be set to
-                                   boost::mpl::true_.
-                
                 returns = 'value' depends on whether or not the optional TTI_U is specified.
                 
                           If TTI_U is not specified, then 'value' is true if the 'name' type 
-                          exists within the enclosing type TTI_T, otherwise 'value' is false.
+                          exists within the enclosing type TTI_T; otherwise 'value' is false.
                           
-                          If TTI_U is specified there are two possibiltities:
-                          
-                          1) TTI_U is an MPL lambda expression and TTI_B is not specified ( or 
-                             specified as the default boost::mpl::false_ ), then 'value' is true 
-                             if the 'name' type exists within the enclosing type TTI_T and the 
-                             lambda expression as specified by TTI_U, invoked by passing the 
-                             actual inner type of 'name', returns a 'value' of true, otherwise 
-                             'value' is false.
-                             
-                          2) TTI_U is not an MPL lambda expression or TTI_B is boost::mpl::true_,
-                             'value' is true if the 'name' type exists within the enclosing type 
-                             TTI_T and the TTI_U type is the same as the actual inner type,
-                             otherwise 'value' is false.
+                          If TTI_U is specified , then 'value' is true if the 'name' type exists 
+                          within the enclosing type TTI_T and the lambda expression as specified 
+                          by TTI_U, invoked by passing the actual inner type of 'name', returns 
+                          a 'value' of true; otherwise 'value' is false.
                              
-                          In either case the action taken with TTI_U occurs only when the 'name'
-                          type exists within the enclosing type TTI_T.
+                          The action taken with TTI_U occurs only when the 'name' type exists 
+                          within the enclosing type TTI_T.
                              
   Example usage:
   
@@ -93,30 +72,28 @@
   
   LookFor<EnclosingType>::value is true if MyType is an inner type of EnclosingType, otherwise false.
   
-  LookFor<EnclosingType,AnotherType>::value is true if MyType is an inner type of EnclosingType
-    and the inner type is the same type as AnotherType, otherwise false.
-    
   LookFor<EnclosingType,ALambdaExpression>::value is true if MyType is an inner type of EnclosingType
     and invoking ALambdaExpression with the inner type returns a value of true, otherwise false.
-  
-  LookFor<EnclosingType,ALambdaExpression,boost::mpl::true_>::value is true if MyType is an inner type 
-    of EnclosingType and the inner type is the same type as ALambdaExpression, otherwise false.
     
+  A popular use of the optional MPL lambda expression is to check whether the type found is the same  
+  as another type, when the type found is a typedef. In that case our example would be:
+  
+  LookFor<EnclosingType,boost::is_same<_,SomeOtherType> >::value is true if MyType is an inner type
+    of EnclosingType and is the same type as SomeOtherType.
+  
 */
 #define BOOST_TTI_TRAIT_HAS_TYPE(trait,name) \
   BOOST_TTI_DETAIL_TRAIT_HAS_TYPE(trait,name) \
   template \
     < \
     class TTI_T, \
-    class TTI_U = BOOST_TTI_NAMESPACE::detail::deftype, \
-    class TTI_B = boost::mpl::false_ \
+    class TTI_U = BOOST_TTI_NAMESPACE::detail::deftype \
     > \
   struct trait : \
     BOOST_PP_CAT(trait,_detail_type) \
       < \
       TTI_T, \
       TTI_U, \
-      TTI_B, \
       typename BOOST_PP_CAT(trait,_detail_type_mpl)<TTI_T>::type \
       > \
     { \
@@ -127,14 +104,14 @@
 
     BOOST_TTI_HAS_TYPE is a macro which expands to a metafunction.
     The metafunction tests whether an inner type with a particular name exists
-    and, optionally, whether a second type is the same type as the inner type
-    or whether a lambda expression invoked with the inner type is true or not.
+    and, optionally, whether a lambda expression invoked with the inner type 
+    is true or not.
     
     name  = the name of the inner type.
 
     generates a metafunction called "has_type_'name'" where 'name' is the macro parameter.
     
-              template<class TTI_T,class TTI_U,class TTI_B>
+              template<class TTI_T,class TTI_U>
               struct has_type_'name'
                 {
                 static const value = unspecified;
@@ -145,44 +122,23 @@
     
                 TTI_T = the enclosing type in which to look for our 'name'.
                 
-                TTI_U = (optional) An optional template parameter, defaulting to a marker type.. 
-                                   If specified it is a type which is one of two possibilities.
+                TTI_U = (optional) An optional template parameter, defaulting to a marker type.
+                                   If specified it is an MPL lambda expression which is invoked 
+                                   with the inner type found and must return a constant boolean 
+                                   value.
                                    
-                                   1) A type, which if specified, is checked to be the same as
-                                      the inner type found.
-                                      
-                                   2) An MPL lambda expression which is invoked with the inner 
-                                      type found and must return a constant boolean value.
-                                      
-                TTI_B = (optional) An optional template parameter of type boost::mpl::bool_,
-                                   defaulting to boost::mpl::false_.
-                                   
-                                   If TTI_U is an MPL lambda expression, whose type is meant to 
-                                   be checked to be the same as the inner type, rather than be 
-                                   invoked by the inner type, this parameter shoud be set to
-                                   boost::mpl::true_.
-                
                 returns = 'value' depends on whether or not the optional TTI_U is specified.
                 
                           If TTI_U is not specified, then 'value' is true if the 'name' type 
-                          exists within the enclosing type TTI_T, otherwise 'value' is false.
+                          exists within the enclosing type TTI_T; otherwise 'value' is false.
                           
-                          If TTI_U is specified there are two possibiltities:
-                          
-                          1) TTI_U is an MPL lambda expression and TTI_B is not specified ( or 
-                             specified as the default boost::mpl::false_ ), then 'value' is true 
-                             if the 'name' type exists within the enclosing type TTI_T and the 
-                             lambda expression as specified by TTI_U, invoked by passing the 
-                             actual inner type of 'name', returns a 'value' of true, otherwise 
-                             'value' is false.
-                             
-                          2) TTI_U is not an MPL lambda expression or TTI_B is boost::mpl::true_,
-                             'value' is true if the 'name' type exists within the enclosing type 
-                             TTI_T and the TTI_U type is the same as the actual inner type,
-                             otherwise 'value' is false.
+                          If TTI_U is specified , then 'value' is true if the 'name' type exists 
+                          within the enclosing type TTI_T and the lambda expression as specified 
+                          by TTI_U, invoked by passing the actual inner type of 'name', returns 
+                          a 'value' of true; otherwise 'value' is false.
                              
-                          In either case the action taken with TTI_U occurs only when the 'name'
-                          type exists within the enclosing type TTI_T.
+                          The action taken with TTI_U occurs only when the 'name' type exists 
+                          within the enclosing type TTI_T.
                              
   Example usage:
   
@@ -191,15 +147,15 @@
   
   has_type_MyType<EnclosingType>::value is true if MyType is an inner type of EnclosingType, otherwise false.
   
-  has_type_MyType<EnclosingType,AnotherType>::value is true if MyType is an inner type of EnclosingType
-    and the inner type is the same type as AnotherType, otherwise false.
-    
   has_type_MyType<EnclosingType,ALambdaExpression>::value is true if MyType is an inner type of EnclosingType
     and invoking ALambdaExpression with the inner type returns a value of true, otherwise false.
   
-  has_type_MyType<EnclosingType,ALambdaExpression,boost::mpl::true_>::value is true if MyType is an inner type 
-    of EnclosingType and the inner type is the same type as ALambdaExpression, otherwise false.
-    
+  A popular use of the optional MPL lambda expression is to check whether the type found is the same  
+  as another type, when the type found is a typedef. In that case our example would be:
+  
+  has_type_MyType<EnclosingType,boost::is_same<_,SomeOtherType> >::value is true if MyType is an inner type
+    of EnclosingType and is the same type as SomeOtherType.
+  
 */
 #define BOOST_TTI_HAS_TYPE(name) \
   BOOST_TTI_TRAIT_HAS_TYPE \
Modified: trunk/libs/tti/test/test_has_type_ct.cpp
==============================================================================
--- trunk/libs/tti/test/test_has_type_ct.cpp	(original)
+++ trunk/libs/tti/test/test_has_type_ct.cpp	2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
@@ -6,19 +6,22 @@
 
 #include "test_has_type.hpp"
 #include <boost/detail/lightweight_test.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/type_traits/is_same.hpp>
+using namespace boost::mpl::placeholders;
 
 int main()
   {
   
-  BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(AnIntType)<AType,int>::value));
-  BOOST_TEST((NameStruct<AType,AType::AStructType>::value));
-  BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(AnIntTypeReference)<AType,int &>::value));
-  BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(BType)<AType,AType::BType>::value));
-  BOOST_TEST((TheInteger<AType::BType,int>::value));
-  BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(CType)<AType::BType,AType::BType::CType>::value));
-  BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(AnotherIntegerType)<AType::BType::CType,int>::value));
-  BOOST_TEST((SomethingElse<AnotherType,AType::AnIntType>::value));
-  BOOST_TEST((!BOOST_TTI_HAS_TYPE_GEN(NoOtherType)<AnotherType,double>::value));
+  BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(AnIntType)<AType,boost::is_same<int,_> >::value));
+  BOOST_TEST((NameStruct<AType,boost::is_same<AType::AStructType,_> >::value));
+  BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(AnIntTypeReference)<AType,boost::is_same<int &,_> >::value));
+  BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(BType)<AType,boost::is_same<AType::BType,_> >::value));
+  BOOST_TEST((TheInteger<AType::BType,boost::is_same<int,_> >::value));
+  BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(CType)<AType::BType,boost::is_same<AType::BType::CType,_> >::value));
+  BOOST_TEST((BOOST_TTI_HAS_TYPE_GEN(AnotherIntegerType)<AType::BType::CType,boost::is_same<int,_> >::value));
+  BOOST_TEST((SomethingElse<AnotherType,boost::is_same<AType::AnIntType,_> >::value));
+  BOOST_TEST((!BOOST_TTI_HAS_TYPE_GEN(NoOtherType)<AnotherType,boost::is_same<double,_> >::value));
   
   return boost::report_errors();
 
Modified: trunk/libs/tti/test/test_has_type_ct_compile.cpp
==============================================================================
--- trunk/libs/tti/test/test_has_type_ct_compile.cpp	(original)
+++ trunk/libs/tti/test/test_has_type_ct_compile.cpp	2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
@@ -6,25 +6,28 @@
 
 #include "test_has_type.hpp"
 #include <boost/mpl/assert.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/type_traits/is_same.hpp>
+using namespace boost::mpl::placeholders;
 
 int main()
   {
   
   // You can always instantiate without compiler errors
   
-  TheInteger<AType::BType,short> aVar;
-  BOOST_TTI_HAS_TYPE_GEN(NoOtherType)<AnotherType,double> aVar2;
+  TheInteger<AType::BType,boost::is_same<short,_> > aVar;
+  BOOST_TTI_HAS_TYPE_GEN(NoOtherType)<AnotherType,boost::is_same<double,_> > aVar2;
   
   // Compile time asserts
   
-  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnIntType)<AType,int>));
-  BOOST_MPL_ASSERT((NameStruct<AType,AType::AStructType>));
-  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnIntTypeReference)<AType,int &>));
-  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(BType)<AType,AType::BType>));
-  BOOST_MPL_ASSERT((TheInteger<AType::BType,int>));
-  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(CType)<AType::BType,AType::BType::CType>));
-  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnotherIntegerType)<AType::BType::CType,int>));
-  BOOST_MPL_ASSERT((SomethingElse<AnotherType,AType::AnIntType>));
+  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnIntType)<AType,boost::is_same<int,_> >));
+  BOOST_MPL_ASSERT((NameStruct<AType,boost::is_same<AType::AStructType,_> >));
+  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnIntTypeReference)<AType,boost::is_same<int &,_> >));
+  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(BType)<AType,boost::is_same<AType::BType,_> >));
+  BOOST_MPL_ASSERT((TheInteger<AType::BType,boost::is_same<int,_> >));
+  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(CType)<AType::BType,boost::is_same<AType::BType::CType,_> >));
+  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnotherIntegerType)<AType::BType::CType,boost::is_same<int,_> >));
+  BOOST_MPL_ASSERT((SomethingElse<AnotherType,boost::is_same<AType::AnIntType,_> >));
   
   return 0;
 
Modified: trunk/libs/tti/test/test_has_type_ct_fail.cpp
==============================================================================
--- trunk/libs/tti/test/test_has_type_ct_fail.cpp	(original)
+++ trunk/libs/tti/test/test_has_type_ct_fail.cpp	2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
@@ -6,13 +6,16 @@
 
 #include "test_has_type.hpp"
 #include <boost/mpl/assert.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/type_traits/is_same.hpp>
+using namespace boost::mpl::placeholders;
 
 int main()
   {
   
   // NoOtherType does not exist at all
   
-  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(NoOtherType)<AType,int>));
+  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(NoOtherType)<AType,boost::is_same<int,_> >));
   
   return 0;
 
Modified: trunk/libs/tti/test/test_has_type_ct_fail2.cpp
==============================================================================
--- trunk/libs/tti/test/test_has_type_ct_fail2.cpp	(original)
+++ trunk/libs/tti/test/test_has_type_ct_fail2.cpp	2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
@@ -6,13 +6,16 @@
 
 #include "test_has_type.hpp"
 #include <boost/mpl/assert.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/type_traits/is_same.hpp>
+using namespace boost::mpl::placeholders;
 
 int main()
   {
   
   // Wrong enclosing type
   
-  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(BType)<AnotherType,short>));
+  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(BType)<AnotherType,boost::is_same<short,_> >));
   
   return 0;
 
Modified: trunk/libs/tti/test/test_has_type_ct_fail3.cpp
==============================================================================
--- trunk/libs/tti/test/test_has_type_ct_fail3.cpp	(original)
+++ trunk/libs/tti/test/test_has_type_ct_fail3.cpp	2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
@@ -5,13 +5,16 @@
 //  http://www.boost.org/LICENSE_1_0.txt).
 
 #include "test_has_type.hpp"
+#include <boost/mpl/placeholders.hpp>
+#include <boost/type_traits/is_same.hpp>
+using namespace boost::mpl::placeholders;
 
 int main()
   {
   
   // Enclosing type does not exist
   
-  TheInteger<AType::EType,double> aVar;
+  TheInteger<AType::EType,boost::is_same<double,_> > aVar;
   
   return 0;
 
Modified: trunk/libs/tti/test/test_has_type_ct_fail4.cpp
==============================================================================
--- trunk/libs/tti/test/test_has_type_ct_fail4.cpp	(original)
+++ trunk/libs/tti/test/test_has_type_ct_fail4.cpp	2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
@@ -5,13 +5,16 @@
 //  http://www.boost.org/LICENSE_1_0.txt).
 
 #include "test_has_type.hpp"
+#include <boost/mpl/placeholders.hpp>
+#include <boost/type_traits/is_same.hpp>
+using namespace boost::mpl::placeholders;
 
 int main()
   {
   
   // Typedef type does not exist ( BType is a nested type )
   
-  BOOST_TTI_HAS_TYPE_GEN(BType)<AType,BType> aVar;
+  BOOST_TTI_HAS_TYPE_GEN(BType)<AType,boost::is_same<BType,_> > aVar;
   
   return 0;
 
Modified: trunk/libs/tti/test/test_has_type_ct_fail5.cpp
==============================================================================
--- trunk/libs/tti/test/test_has_type_ct_fail5.cpp	(original)
+++ trunk/libs/tti/test/test_has_type_ct_fail5.cpp	2012-12-03 00:13:45 EST (Mon, 03 Dec 2012)
@@ -6,13 +6,16 @@
 
 #include "test_has_type.hpp"
 #include <boost/mpl/assert.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/type_traits/is_same.hpp>
+using namespace boost::mpl::placeholders;
 
 int main()
   {
   
   // Wrong typedef type
   
-  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnotherIntegerType)<AType::BType::CType,long>));
+  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnotherIntegerType)<AType::BType::CType,boost::is_same<long,_> >));
   
   return 0;