diff --git a/test/Jamfile b/test/Jamfile index fb6938f..f119c29 100755 --- a/test/Jamfile +++ b/test/Jamfile @@ -18,4 +18,25 @@ test-suite "typeof" [ compile template_tpl.cpp : BOOST_TYPEOF_NATIVE : template_tpl_native ] [ compile template_tpl.cpp : BOOST_TYPEOF_COMPLIANT : template_tpl_emulation ] + + [ compile modifiers.cpp : BOOST_TYPEOF_NATIVE : modifiers_native ] + [ compile modifiers.cpp : BOOST_TYPEOF_COMPLIANT : modifiers_emulation ] + + [ compile function.cpp : BOOST_TYPEOF_NATIVE : function_native ] + [ compile function.cpp : BOOST_TYPEOF_COMPLIANT : function_emulation ] + + [ compile function_ptr.cpp : BOOST_TYPEOF_NATIVE : function_ptr_native ] + [ compile function_ptr.cpp : BOOST_TYPEOF_COMPLIANT : function_ptr_emulation ] + + [ compile function_ref.cpp : BOOST_TYPEOF_NATIVE : function_ref_native ] + [ compile function_ref.cpp : BOOST_TYPEOF_COMPLIANT : function_ref_emulation ] + + [ compile member_function.cpp : BOOST_TYPEOF_NATIVE : member_function_native ] + [ compile member_function.cpp : BOOST_TYPEOF_COMPLIANT : member_function_emulation ] + + [ compile data_member.cpp : BOOST_TYPEOF_NATIVE : data_member_native ] + [ compile data_member.cpp : BOOST_TYPEOF_COMPLIANT : data_member_emulation ] + + [ compile lvalue.cpp : BOOST_TYPEOF_NATIVE : lvalue_native ] + [ compile lvalue.cpp : BOOST_TYPEOF_COMPLIANT : lvalue_emulation ] ; diff --git a/test/data_member.cpp b/test/data_member.cpp new file mode 100755 index 0000000..4fd7ab4 --- /dev/null +++ b/test/data_member.cpp @@ -0,0 +1,7 @@ +#include "test.hpp" +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct x; +BOOST_TYPEOF_REGISTER_TYPE(x) + +BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/test/function.cpp b/test/function.cpp new file mode 100755 index 0000000..7ccda62 --- /dev/null +++ b/test/function.cpp @@ -0,0 +1,4 @@ +#include "test.hpp" + +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/test/function_ptr.cpp b/test/function_ptr.cpp new file mode 100755 index 0000000..2e08a15 --- /dev/null +++ b/test/function_ptr.cpp @@ -0,0 +1,6 @@ +#include "test.hpp" + +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/test/function_ref.cpp b/test/function_ref.cpp new file mode 100755 index 0000000..bc9f6ec --- /dev/null +++ b/test/function_ref.cpp @@ -0,0 +1,4 @@ +#include "test.hpp" + +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/test/lvalue.cpp b/test/lvalue.cpp new file mode 100755 index 0000000..eed202a --- /dev/null +++ b/test/lvalue.cpp @@ -0,0 +1,26 @@ +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct x{}; +BOOST_TYPEOF_REGISTER_TYPE(x) + +x n; +const x cn = n; +x& rn = n; +const x& rcn = cn; +x f(); +const x cf(); +x& rf(); +const x& rcf(); + +BOOST_STATIC_ASSERT((boost::is_same::value)); +BOOST_STATIC_ASSERT((boost::is_same::value)); +BOOST_STATIC_ASSERT((boost::is_same::value)); +BOOST_STATIC_ASSERT((boost::is_same::value)); +BOOST_STATIC_ASSERT((boost::is_same::value)); +BOOST_STATIC_ASSERT((boost::is_same::value)); +BOOST_STATIC_ASSERT((boost::is_same::value)); +BOOST_STATIC_ASSERT((boost::is_same::value)); diff --git a/test/member_function.cpp b/test/member_function.cpp new file mode 100755 index 0000000..2e08a15 --- /dev/null +++ b/test/member_function.cpp @@ -0,0 +1,6 @@ +#include "test.hpp" + +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/test/modifiers.cpp b/test/modifiers.cpp new file mode 100755 index 0000000..e14143c --- /dev/null +++ b/test/modifiers.cpp @@ -0,0 +1,12 @@ +#include "test.hpp" +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct x; +BOOST_TYPEOF_REGISTER_TYPE(x) + +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/test/test.hpp b/test/test.hpp index 031d655..b31ac38 100755 --- a/test/test.hpp +++ b/test/test.hpp @@ -11,18 +11,18 @@ namespace boost { namespace type_of { - template + template struct test_wrapper{}; template - test_wrapper test_helper(test_wrapper*); + test_wrapper test_helper(test_wrapper*); template struct test { enum {value = boost::is_same< - BOOST_TYPEOF_TPL(test_helper(reinterpret_cast*>(0))), - test_wrapper + BOOST_TYPEOF_TPL(test_helper(reinterpret_cast*>(0))), + test_wrapper >::value }; }; @@ -30,6 +30,6 @@ namespace boost { namespace type_of { }} #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::type_of::test_wrapper, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::type_of::test_wrapper, 2) #endif//BOOST_TYPEOF_TEST_HPP_INCLUDED