mirror of
https://github.com/boostorg/typeof.git
synced 2025-06-25 12:01:34 +02:00
Compare commits
9 Commits
boost-1.62
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
aa0eaa77f5 | |||
a70cd7396a | |||
c10804f3b0 | |||
4c9b8ba961 | |||
b7bfcbef45 | |||
2d046d3f9f | |||
f2a646b417 | |||
7d3afd076d | |||
6926249653 |
21
CMakeLists.txt
Normal file
21
CMakeLists.txt
Normal file
@ -0,0 +1,21 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# This file was automatically generated from the original CMakeLists.txt file
|
||||
# Add a variable to hold the headers for the library
|
||||
set (lib_headers
|
||||
typeof
|
||||
)
|
||||
|
||||
# Add a library target to the build system
|
||||
boost_library_project(
|
||||
typeof
|
||||
# SRCDIRS
|
||||
TESTDIRS test
|
||||
HEADERS ${lib_headers}
|
||||
# DOCDIRS
|
||||
# DESCRIPTION
|
||||
MODULARIZED
|
||||
# AUTHORS
|
||||
# MAINTAINERS
|
||||
)
|
||||
|
||||
|
0
include/boost/typeof/dmc/typeof_impl.hpp
Executable file → Normal file
0
include/boost/typeof/dmc/typeof_impl.hpp
Executable file → Normal file
0
include/boost/typeof/encode_decode.hpp
Executable file → Normal file
0
include/boost/typeof/encode_decode.hpp
Executable file → Normal file
0
include/boost/typeof/encode_decode_params.hpp
Executable file → Normal file
0
include/boost/typeof/encode_decode_params.hpp
Executable file → Normal file
0
include/boost/typeof/incr_registration_group.hpp
Executable file → Normal file
0
include/boost/typeof/incr_registration_group.hpp
Executable file → Normal file
0
include/boost/typeof/int_encoding.hpp
Executable file → Normal file
0
include/boost/typeof/int_encoding.hpp
Executable file → Normal file
0
include/boost/typeof/integral_template_param.hpp
Executable file → Normal file
0
include/boost/typeof/integral_template_param.hpp
Executable file → Normal file
0
include/boost/typeof/message.hpp
Executable file → Normal file
0
include/boost/typeof/message.hpp
Executable file → Normal file
0
include/boost/typeof/modifiers.hpp
Executable file → Normal file
0
include/boost/typeof/modifiers.hpp
Executable file → Normal file
65
include/boost/typeof/msvc/typeof_impl.hpp
Executable file → Normal file
65
include/boost/typeof/msvc/typeof_impl.hpp
Executable file → Normal file
@ -153,57 +153,7 @@ namespace boost
|
||||
};
|
||||
};
|
||||
# endif
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC,>=1310)
|
||||
template<const std::type_info& ref_type_info>
|
||||
struct msvc_typeid_wrapper {
|
||||
typedef typename msvc_extract_type<msvc_typeid_wrapper>::id2type id2type;
|
||||
typedef typename id2type::type wrapped_type;
|
||||
typedef typename wrapped_type::type type;
|
||||
};
|
||||
//This class is used for registering the type T. encode_type<T> is mapped against typeid(encode_type<T>).
|
||||
//msvc_typeid_wrapper<typeid(encode_type<T>)> will now have a type typedef that equals encode_type<T>.
|
||||
template<typename T>
|
||||
struct encode_type
|
||||
{
|
||||
typedef encode_type<T> input_type;
|
||||
//Invoke registration of encode_type<T>. typeid(encode_type<T>) is now mapped to encode_type<T>. Do not use registered_type for anything.
|
||||
//The reason for registering encode_type<T> rather than T, is that VC handles typeid(function reference) poorly. By adding another
|
||||
//level of indirection, we solve this problem.
|
||||
typedef typename msvc_register_type<input_type,msvc_typeid_wrapper<typeid(input_type)> >::id2type registered_type;
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<typename T> typename disable_if<
|
||||
typename is_function<T>::type,
|
||||
typename encode_type<T>::input_type>::type encode_start(T const&);
|
||||
|
||||
template<typename T> typename enable_if<
|
||||
typename is_function<T>::type,
|
||||
typename encode_type<T>::input_type>::type encode_start(T&);
|
||||
|
||||
template<typename Organizer, typename T>
|
||||
msvc_register_type<T,Organizer> typeof_register_type(const T&);
|
||||
|
||||
# define BOOST_TYPEOF(expr) \
|
||||
boost::type_of::msvc_typeid_wrapper<typeid(boost::type_of::encode_start(expr))>::type
|
||||
|
||||
# define BOOST_TYPEOF_TPL(expr) typename BOOST_TYPEOF(expr)
|
||||
|
||||
# define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \
|
||||
struct name {\
|
||||
enum {_typeof_register_value=sizeof(typeid(boost::type_of::typeof_register_type<name>(expr)))};\
|
||||
typedef typename boost::type_of::msvc_extract_type<name>::id2type id2type;\
|
||||
typedef typename id2type::type type;\
|
||||
};
|
||||
|
||||
# define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \
|
||||
struct name {\
|
||||
enum {_typeof_register_value=sizeof(typeid(boost::type_of::typeof_register_type<name>(expr)))};\
|
||||
typedef boost::type_of::msvc_extract_type<name>::id2type id2type;\
|
||||
typedef id2type::type type;\
|
||||
};
|
||||
|
||||
# else
|
||||
template<int ID>
|
||||
struct msvc_typeid_wrapper {
|
||||
typedef typename msvc_extract_type<mpl::int_<ID> >::id2type id2type;
|
||||
@ -239,10 +189,18 @@ struct name {\
|
||||
{
|
||||
typedef char(*type)[encode_type<T>::value];
|
||||
};
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC,>=1310)
|
||||
template<typename T> typename disable_if<
|
||||
typename is_function<T>::type,
|
||||
typename sizer<T>::type>::type encode_start(T const&);
|
||||
|
||||
template<typename T> typename enable_if<
|
||||
typename is_function<T>::type,
|
||||
typename sizer<T>::type>::type encode_start(T&);
|
||||
# else
|
||||
template<typename T>
|
||||
typename sizer<T>::type encode_start(T const&);
|
||||
|
||||
# endif
|
||||
template<typename Organizer, typename T>
|
||||
msvc_register_type<T,Organizer> typeof_register_type(const T&,Organizer* =0);
|
||||
|
||||
@ -253,19 +211,18 @@ struct name {\
|
||||
|
||||
# define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \
|
||||
struct name {\
|
||||
BOOST_STATIC_CONSTANT(int,_typeof_register_value=sizeof(boost::type_of::typeof_register_type<name>(expr)));\
|
||||
enum {_typeof_register_value=sizeof(boost::type_of::typeof_register_type<name>(expr))};\
|
||||
typedef typename boost::type_of::msvc_extract_type<name>::id2type id2type;\
|
||||
typedef typename id2type::type type;\
|
||||
};
|
||||
|
||||
# define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \
|
||||
struct name {\
|
||||
BOOST_STATIC_CONSTANT(int,_typeof_register_value=sizeof(boost::type_of::typeof_register_type<name>(expr)));\
|
||||
enum {_typeof_register_value=sizeof(boost::type_of::typeof_register_type<name>(expr))};\
|
||||
typedef boost::type_of::msvc_extract_type<name>::id2type id2type;\
|
||||
typedef id2type::type type;\
|
||||
};
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
0
include/boost/typeof/native.hpp
Executable file → Normal file
0
include/boost/typeof/native.hpp
Executable file → Normal file
0
include/boost/typeof/pointers_data_members.hpp
Executable file → Normal file
0
include/boost/typeof/pointers_data_members.hpp
Executable file → Normal file
0
include/boost/typeof/register_functions.hpp
Executable file → Normal file
0
include/boost/typeof/register_functions.hpp
Executable file → Normal file
0
include/boost/typeof/register_functions_iterate.hpp
Executable file → Normal file
0
include/boost/typeof/register_functions_iterate.hpp
Executable file → Normal file
0
include/boost/typeof/register_fundamental.hpp
Executable file → Normal file
0
include/boost/typeof/register_fundamental.hpp
Executable file → Normal file
0
include/boost/typeof/register_mem_functions.hpp
Executable file → Normal file
0
include/boost/typeof/register_mem_functions.hpp
Executable file → Normal file
0
include/boost/typeof/std/bitset.hpp
Executable file → Normal file
0
include/boost/typeof/std/bitset.hpp
Executable file → Normal file
0
include/boost/typeof/std/complex.hpp
Executable file → Normal file
0
include/boost/typeof/std/complex.hpp
Executable file → Normal file
0
include/boost/typeof/std/deque.hpp
Executable file → Normal file
0
include/boost/typeof/std/deque.hpp
Executable file → Normal file
0
include/boost/typeof/std/fstream.hpp
Executable file → Normal file
0
include/boost/typeof/std/fstream.hpp
Executable file → Normal file
0
include/boost/typeof/std/functional.hpp
Executable file → Normal file
0
include/boost/typeof/std/functional.hpp
Executable file → Normal file
0
include/boost/typeof/std/iostream.hpp
Executable file → Normal file
0
include/boost/typeof/std/iostream.hpp
Executable file → Normal file
0
include/boost/typeof/std/istream.hpp
Executable file → Normal file
0
include/boost/typeof/std/istream.hpp
Executable file → Normal file
0
include/boost/typeof/std/iterator.hpp
Executable file → Normal file
0
include/boost/typeof/std/iterator.hpp
Executable file → Normal file
0
include/boost/typeof/std/list.hpp
Executable file → Normal file
0
include/boost/typeof/std/list.hpp
Executable file → Normal file
0
include/boost/typeof/std/locale.hpp
Executable file → Normal file
0
include/boost/typeof/std/locale.hpp
Executable file → Normal file
0
include/boost/typeof/std/map.hpp
Executable file → Normal file
0
include/boost/typeof/std/map.hpp
Executable file → Normal file
0
include/boost/typeof/std/memory.hpp
Executable file → Normal file
0
include/boost/typeof/std/memory.hpp
Executable file → Normal file
0
include/boost/typeof/std/ostream.hpp
Executable file → Normal file
0
include/boost/typeof/std/ostream.hpp
Executable file → Normal file
0
include/boost/typeof/std/queue.hpp
Executable file → Normal file
0
include/boost/typeof/std/queue.hpp
Executable file → Normal file
0
include/boost/typeof/std/set.hpp
Executable file → Normal file
0
include/boost/typeof/std/set.hpp
Executable file → Normal file
0
include/boost/typeof/std/sstream.hpp
Executable file → Normal file
0
include/boost/typeof/std/sstream.hpp
Executable file → Normal file
0
include/boost/typeof/std/stack.hpp
Executable file → Normal file
0
include/boost/typeof/std/stack.hpp
Executable file → Normal file
0
include/boost/typeof/std/streambuf.hpp
Executable file → Normal file
0
include/boost/typeof/std/streambuf.hpp
Executable file → Normal file
0
include/boost/typeof/std/string.hpp
Executable file → Normal file
0
include/boost/typeof/std/string.hpp
Executable file → Normal file
0
include/boost/typeof/std/utility.hpp
Executable file → Normal file
0
include/boost/typeof/std/utility.hpp
Executable file → Normal file
0
include/boost/typeof/std/valarray.hpp
Executable file → Normal file
0
include/boost/typeof/std/valarray.hpp
Executable file → Normal file
0
include/boost/typeof/std/vector.hpp
Executable file → Normal file
0
include/boost/typeof/std/vector.hpp
Executable file → Normal file
0
include/boost/typeof/template_encoding.hpp
Executable file → Normal file
0
include/boost/typeof/template_encoding.hpp
Executable file → Normal file
0
include/boost/typeof/template_template_param.hpp
Executable file → Normal file
0
include/boost/typeof/template_template_param.hpp
Executable file → Normal file
0
include/boost/typeof/type_encoding.hpp
Executable file → Normal file
0
include/boost/typeof/type_encoding.hpp
Executable file → Normal file
0
include/boost/typeof/type_template_param.hpp
Executable file → Normal file
0
include/boost/typeof/type_template_param.hpp
Executable file → Normal file
0
include/boost/typeof/typeof.hpp
Executable file → Normal file
0
include/boost/typeof/typeof.hpp
Executable file → Normal file
0
include/boost/typeof/typeof_impl.hpp
Executable file → Normal file
0
include/boost/typeof/typeof_impl.hpp
Executable file → Normal file
0
include/boost/typeof/vector.hpp
Executable file → Normal file
0
include/boost/typeof/vector.hpp
Executable file → Normal file
0
include/boost/typeof/vector100.hpp
Executable file → Normal file
0
include/boost/typeof/vector100.hpp
Executable file → Normal file
0
include/boost/typeof/vector150.hpp
Executable file → Normal file
0
include/boost/typeof/vector150.hpp
Executable file → Normal file
0
include/boost/typeof/vector200.hpp
Executable file → Normal file
0
include/boost/typeof/vector200.hpp
Executable file → Normal file
0
include/boost/typeof/vector50.hpp
Executable file → Normal file
0
include/boost/typeof/vector50.hpp
Executable file → Normal file
2
index.html
Executable file → Normal file
2
index.html
Executable file → Normal file
@ -10,7 +10,7 @@ License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
</head>
|
||||
<body>
|
||||
Automatic redirection failed, please go to
|
||||
<a href="../../doc/html/xpressive.html">../../doc/html/typeof.html</a>
|
||||
<a href="../../doc/html/typeof.html">../../doc/html/typeof.html</a>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
1
module.cmake
Normal file
1
module.cmake
Normal file
@ -0,0 +1 @@
|
||||
boost_module(typeof DEPENDS mpl config detail preprocessor)
|
24
test/CMakeLists.txt
Normal file
24
test/CMakeLists.txt
Normal file
@ -0,0 +1,24 @@
|
||||
boost_additional_test_dependencies(typeof BOOST_DEPENDS test)
|
||||
|
||||
|
||||
file(GLOB TEST_FILES "*.cpp")
|
||||
foreach(TEST_FILE ${TEST_FILES})
|
||||
if (TEST_FILE MATCHES "odr.*cpp")
|
||||
# Skip ODR tests; we'll handle them separately
|
||||
else (TEST_FILE MATCHES "odr.*cpp")
|
||||
get_filename_component(TEST_NAME ${TEST_FILE} NAME_WE)
|
||||
boost_test_compile("${TEST_NAME}_native"
|
||||
"${TEST_NAME}.cpp" COMPILE_FLAGS "-DBOOST_TYPEOF_NATIVE")
|
||||
boost_test_compile("${TEST_NAME}_emulation"
|
||||
"${TEST_NAME}.cpp" COMPILE_FLAGS "-DBOOST_TYPEOF_EMULATION")
|
||||
endif (TEST_FILE MATCHES "odr.*cpp")
|
||||
endforeach(TEST_FILE ${TEST_FILES})
|
||||
|
||||
boost_test_run(odr_native
|
||||
odr1.cpp odr2.cpp COMPILE_FLAGS "-DBOOST_TYPEOF_NATIVE")
|
||||
boost_test_run(odr_emulation
|
||||
odr1.cpp odr2.cpp COMPILE_FLAGS "-DBOOST_TYPEOF_EMULATION")
|
||||
boost_test_run(odr_no_uns
|
||||
odr_no_uns1.cpp odr_no_uns2.cpp
|
||||
COMPILE_FLAGS "-DBOOST_TYPEOF_EMULATION")
|
||||
|
0
test/data_member.cpp
Executable file → Normal file
0
test/data_member.cpp
Executable file → Normal file
0
test/function.cpp
Executable file → Normal file
0
test/function.cpp
Executable file → Normal file
0
test/function_binding.cpp
Executable file → Normal file
0
test/function_binding.cpp
Executable file → Normal file
0
test/function_ptr.cpp
Executable file → Normal file
0
test/function_ptr.cpp
Executable file → Normal file
0
test/function_ptr_from_tpl.cpp
Executable file → Normal file
0
test/function_ptr_from_tpl.cpp
Executable file → Normal file
0
test/function_ref.cpp
Executable file → Normal file
0
test/function_ref.cpp
Executable file → Normal file
0
test/member_function.cpp
Executable file → Normal file
0
test/member_function.cpp
Executable file → Normal file
0
test/modifiers.cpp
Executable file → Normal file
0
test/modifiers.cpp
Executable file → Normal file
0
test/noncopyable.cpp
Executable file → Normal file
0
test/noncopyable.cpp
Executable file → Normal file
0
test/odr.hpp
Executable file → Normal file
0
test/odr.hpp
Executable file → Normal file
0
test/odr1.cpp
Executable file → Normal file
0
test/odr1.cpp
Executable file → Normal file
0
test/odr2.cpp
Executable file → Normal file
0
test/odr2.cpp
Executable file → Normal file
0
test/odr_no_uns1.cpp
Executable file → Normal file
0
test/odr_no_uns1.cpp
Executable file → Normal file
0
test/odr_no_uns1.hpp
Executable file → Normal file
0
test/odr_no_uns1.hpp
Executable file → Normal file
0
test/odr_no_uns2.cpp
Executable file → Normal file
0
test/odr_no_uns2.cpp
Executable file → Normal file
0
test/odr_no_uns2.hpp
Executable file → Normal file
0
test/odr_no_uns2.hpp
Executable file → Normal file
0
test/std.cpp
Executable file → Normal file
0
test/std.cpp
Executable file → Normal file
0
test/template_dependent.cpp
Executable file → Normal file
0
test/template_dependent.cpp
Executable file → Normal file
0
test/template_enum.cpp
Executable file → Normal file
0
test/template_enum.cpp
Executable file → Normal file
0
test/template_int.cpp
Executable file → Normal file
0
test/template_int.cpp
Executable file → Normal file
0
test/template_multiword.cpp
Executable file → Normal file
0
test/template_multiword.cpp
Executable file → Normal file
0
test/template_tpl.cpp
Executable file → Normal file
0
test/template_tpl.cpp
Executable file → Normal file
0
test/template_type.cpp
Executable file → Normal file
0
test/template_type.cpp
Executable file → Normal file
0
test/test.hpp
Executable file → Normal file
0
test/test.hpp
Executable file → Normal file
0
test/type.cpp
Executable file → Normal file
0
test/type.cpp
Executable file → Normal file
@ -1,7 +1,7 @@
|
||||
# // (C) Copyright Tobias Schwinger
|
||||
# //
|
||||
# // Use modification and distribution are subject to the boost Software License
|
||||
# // Version 1.0. (See http:/\/www.boost.org/LICENSE_1_0.txt).
|
||||
# // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
|
||||
|
||||
# // Preprocess and run this script.
|
||||
# //
|
||||
|
Reference in New Issue
Block a user