forked from boostorg/typeof
initial commit
[SVN r30738]
This commit is contained in:
1 parent
08c09b86b3
commit
b48bd6a7a0
3 files changed
+54
No files matched your search
Executable
+35
@@ -0,0 +1,35 @@
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_TYPEOF_TEST_HPP_INCLUDED
|
||||
#define BOOST_TYPEOF_TEST_HPP_INCLUDED
|
||||
|
||||
#include <boost/typeof/typeof.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost { namespace type_of {
|
||||
|
||||
template<class T>
|
||||
struct test_wrapper{};
|
||||
|
||||
template<class T>
|
||||
test_wrapper<T> test_helper(test_wrapper<T>*);
|
||||
|
||||
template<class T>
|
||||
struct test
|
||||
{
|
||||
enum {value = boost::is_same<
|
||||
BOOST_TYPEOF_TPL(test_helper(reinterpret_cast<test_wrapper<T>*>(0))),
|
||||
test_wrapper<T>
|
||||
>::value
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::type_of::test_wrapper, 1)
|
||||
|
||||
#endif//BOOST_TYPEOF_TEST_HPP_INCLUDED
|
||||
Reference in new issue
Block a user