Compare commits

...

23 Commits

Author SHA1 Message Date
fad4c07a30 Quickbook: Copy trunk headers into quickbook-dev.
[SVN r75212]
2011-11-01 13:03:44 +00:00
9fcf6ff70e reverting accidently commited change
[SVN r75052]
2011-10-18 17:25:37 +00:00
2334bc2bf7 added full qualification to enable_if for the member pointer operator
[SVN r75050]
2011-10-18 16:09:48 +00:00
731e9ce0ad Applied patch for #5745: Use native typeof support for Oracle Solaris Studio C++ compiler
[SVN r73579]
2011-08-06 18:46:43 +00:00
a237b04a19 Quickbook: New branch for development.
From now on this will be my development branch.


[SVN r70613]
2011-03-27 10:17:05 +00:00
b46f8efd6b Ticket #3520 Syntax Error in boost/typeof/typeof.hpp
Line 18 of boost/typeof/typeof.hpp fixed from
# ifndef(BOOST_TYPEOF_EMULATION)
to
# ifndef BOOST_TYPEOF_EMULATION

[SVN r65138]
2010-08-30 20:21:47 +00:00
c75b62533a #4605: Make BOOST_TYPEOF_SILENT default
BOOST_TYPEOF_SILENT has been removed and BOOST_TYPEOF_MESSAGES has been added.
Messages are now hidden by default, and you have to define BOOST_TYPEOF_MESSAGES to see them at all.

[SVN r65137]
2010-08-30 20:08:29 +00:00
d04dc539a0 Removed tabs from file
[SVN r65136]
2010-08-30 20:00:04 +00:00
1468636543 #4593: Type_of does not use BOOST_TYPEOF_EMULATION for VC10 and \Za - fixed
[SVN r65135]
2010-08-30 19:29:02 +00:00
468e0de51e Allow inclusion of typeof.hpp for compilers (borland) that does not support typeof emulation or native typeof. For these compilers, BOOST_TYPEOF_EMULATION_UNSUPPORTED will be defined, and BOOST_TYPEOF(Expr) will always result in boost::type_of::typeof_emulation_is_unsupported_on_this_compiler
[SVN r63369]
2010-06-26 20:28:49 +00:00
dcb1e95d25 Added documentation of BOOST_TYPEOF_SILENT
[SVN r63367]
2010-06-26 19:12:01 +00:00
3892d59ff8 Update various libraries' documentation build.
Mostly to use the images and css files under doc/src instead of
doc/html, usually be deleting the settings in order to use the defaults.
Also add 'boost.root' to some builds in order to fix links which rely on
it.

[SVN r63146]
2010-06-20 18:00:48 +00:00
eff78826d2 Apply variadic functions patch from Sergey Zubkovsky.
[SVN r59579]
2010-02-07 19:13:43 +00:00
b420583f9c rm cmake from trunk. I'm not entirely sure this is necessary to satisfy the inspect script, but I'm not taking any chances, and it is easy to put back
[SVN r56942]
2009-10-17 02:07:38 +00:00
9a5663ff14 Copyrights on CMakeLists.txt to keep them from clogging up the inspect
reports.  This is essentially the same commit as r55095 on the release
branch.



[SVN r55159]
2009-07-26 00:49:56 +00:00
a70cd7396a BOOST_TYPEOF_NESTED_TYPEDEF now supports expressions containing "this" for VC compilers
[SVN r51687]
2009-03-10 18:07:38 +00:00
c10804f3b0 Removed use of typeid in typeof implementation for VC7.1, as this caused problems in some uses of BOOST_TYPEOF
[SVN r51681]
2009-03-10 09:33:21 +00:00
4c9b8ba961 Fix a link in the typeof forwarding html file.
[SVN r50838]
2009-01-28 09:14:45 +00:00
b7bfcbef45 Updating dependency information for modularized libraries.
[SVN r49628]
2008-11-07 17:05:27 +00:00
2d046d3f9f Updating CMake files to latest trunk. Added dependency information for regression tests and a few new macros for internal use.
[SVN r49627]
2008-11-07 17:02:56 +00:00
f2a646b417 Continuing merge of CMake build system files into trunk with the encouragement of Doug Gregor
[SVN r49510]
2008-11-01 13:15:41 +00:00
7d3afd076d removes unnecessary escaping
[SVN r43411]
2008-02-25 11:45:51 +00:00
6926249653 Revert to old sizeof based solution for retrieving the type from a typeof hack. This is in order to overcome problems with the code analysis module introduced in Visual Studio 2005.
[SVN r41383]
2007-11-25 21:16:46 +00:00
78 changed files with 201 additions and 95 deletions

View File

@ -10,6 +10,7 @@ boostbook standalone
:
typeof
:
<xsl:param>boost.root=../../../..
<xsl:param>nav.layout=none
<xsl:param>navig.graphics=0
;

View File

@ -1,4 +1,4 @@
[library Boost.Typeof
[library Boost.Typeof
[authors [Vertleyb, Arkadiy], [Holt, Peder]]
[copyright 2004 2005 Arkadiy Vertleyb, Peder Holt]
[license
@ -383,6 +383,14 @@ Redefine if you want the Typeof Library to handle functions with more parameters
[endsect]
[section:messages MESSAGES]
Define `BOOST_TYPEOF_MESSAGE` before including boost/typeof/typeof.hpp to
include messages "using typeof emulation" and "using native typeof".
By default, these messages will not be displayed.
[endsect]
[section:limit_size LIMIT_SIZE]
The `BOOST_TYPEOF_LIMIT_SIZE` macro defines the size of the compile-time sequence

0
include/boost/typeof/dmc/typeof_impl.hpp Executable file → Normal file
View File

0
include/boost/typeof/encode_decode.hpp Executable file → Normal file
View File

0
include/boost/typeof/encode_decode_params.hpp Executable file → Normal file
View File

0
include/boost/typeof/incr_registration_group.hpp Executable file → Normal file
View File

0
include/boost/typeof/int_encoding.hpp Executable file → Normal file
View File

0
include/boost/typeof/integral_template_param.hpp Executable file → Normal file
View File

2
include/boost/typeof/message.hpp Executable file → Normal file
View File

@ -2,7 +2,7 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#if defined(_MSC_VER) && !defined BOOST_TYPEOF_SILENT
#if defined(_MSC_VER) && defined BOOST_TYPEOF_MESSAGES
# pragma message(BOOST_TYPEOF_TEXT)
#endif
#undef BOOST_TYPEOF_TEXT

0
include/boost/typeof/modifiers.hpp Executable file → Normal file
View File

65
include/boost/typeof/msvc/typeof_impl.hpp Executable file → Normal file
View 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
View File

0
include/boost/typeof/pointers_data_members.hpp Executable file → Normal file
View File

19
include/boost/typeof/register_functions.hpp Executable file → Normal file
View File

@ -24,12 +24,19 @@
enum
{
FUN_ID = BOOST_TYPEOF_UNIQUE_ID(),
FUN_PTR_ID = FUN_ID + 1 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
FUN_REF_ID = FUN_ID + 2 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
MEM_FUN_ID = FUN_ID + 3 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
CONST_MEM_FUN_ID = FUN_ID + 4 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
VOLATILE_MEM_FUN_ID = FUN_ID + 5 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
VOLATILE_CONST_MEM_FUN_ID = FUN_ID + 6 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY)
FUN_PTR_ID = FUN_ID + 1 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
FUN_REF_ID = FUN_ID + 2 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
MEM_FUN_ID = FUN_ID + 3 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
CONST_MEM_FUN_ID = FUN_ID + 4 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
VOLATILE_MEM_FUN_ID = FUN_ID + 5 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
VOLATILE_CONST_MEM_FUN_ID = FUN_ID + 6 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
FUN_VAR_ID = FUN_ID + 7 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
FUN_VAR_PTR_ID = FUN_ID + 8 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
FUN_VAR_REF_ID = FUN_ID + 9 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
MEM_FUN_VAR_ID = FUN_ID + 10 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
CONST_MEM_FUN_VAR_ID = FUN_ID + 11 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
VOLATILE_MEM_FUN_VAR_ID = FUN_ID + 12 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
VOLATILE_CONST_MEM_FUN_VAR_ID = FUN_ID + 13 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY)
};
BOOST_TYPEOF_BEGIN_ENCODE_NS

48
include/boost/typeof/register_functions_iterate.hpp Executable file → Normal file
View File

@ -15,6 +15,13 @@ struct encode_type_impl<V, R(*)(BOOST_PP_ENUM_PARAMS(n, P))>
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_PTR_ID + n) type;
};
template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(*)(BOOST_PP_ENUM_PARAMS(n, P) ...)>
{
typedef R BOOST_PP_CAT(P, n);
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_VAR_PTR_ID + n) type;
};
template<class Iter>
struct decode_type_impl<boost::mpl::size_t<FUN_PTR_ID + n>, Iter>
{
@ -24,6 +31,15 @@ struct decode_type_impl<boost::mpl::size_t<FUN_PTR_ID + n>, Iter>
typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
};
template<class Iter>
struct decode_type_impl<boost::mpl::size_t<FUN_VAR_PTR_ID + n>, Iter>
{
typedef Iter iter0;
BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n))
typedef BOOST_PP_CAT(p, n)(*type)(BOOST_PP_ENUM_PARAMS(n, p) ...);
typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
};
#ifndef BOOST_TYPEOF_NO_FUNCTION_TYPES
// function references
@ -35,6 +51,13 @@ struct decode_type_impl<boost::mpl::size_t<FUN_PTR_ID + n>, Iter>
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_REF_ID + n) type;
};
template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(&)(BOOST_PP_ENUM_PARAMS(n, P) ...)>
{
typedef R BOOST_PP_CAT(P, n);
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_VAR_REF_ID + n) type;
};
template<class Iter>
struct decode_type_impl<boost::mpl::size_t<FUN_REF_ID + n>, Iter>
{
@ -44,6 +67,15 @@ struct decode_type_impl<boost::mpl::size_t<FUN_PTR_ID + n>, Iter>
typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
};
template<class Iter>
struct decode_type_impl<boost::mpl::size_t<FUN_VAR_REF_ID + n>, Iter>
{
typedef Iter iter0;
BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n))
typedef BOOST_PP_CAT(p, n)(&type)(BOOST_PP_ENUM_PARAMS(n, p) ...);
typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
};
// functions
template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
@ -53,6 +85,13 @@ struct decode_type_impl<boost::mpl::size_t<FUN_PTR_ID + n>, Iter>
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_ID + n) type;
};
template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(BOOST_PP_ENUM_PARAMS(n, P) ...)>
{
typedef R BOOST_PP_CAT(P, n);
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_VAR_ID + n) type;
};
template<class Iter>
struct decode_type_impl<boost::mpl::size_t<FUN_ID + n>, Iter>
{
@ -62,6 +101,15 @@ struct decode_type_impl<boost::mpl::size_t<FUN_PTR_ID + n>, Iter>
typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
};
template<class Iter>
struct decode_type_impl<boost::mpl::size_t<FUN_VAR_ID + n>, Iter>
{
typedef Iter iter0;
BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n))
typedef BOOST_PP_CAT(p, n)(type)(BOOST_PP_ENUM_PARAMS(n, p) ...);
typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
};
#endif//BOOST_TYPEOF_NO_FUNCTION_TYPES
#ifndef BOOST_TYPEOF_NO_MEMBER_FUNCTION_TYPES

0
include/boost/typeof/register_fundamental.hpp Executable file → Normal file
View File

0
include/boost/typeof/register_mem_functions.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/bitset.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/complex.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/deque.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/fstream.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/functional.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/iostream.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/istream.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/iterator.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/list.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/locale.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/map.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/memory.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/ostream.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/queue.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/set.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/sstream.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/stack.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/streambuf.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/string.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/utility.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/valarray.hpp Executable file → Normal file
View File

0
include/boost/typeof/std/vector.hpp Executable file → Normal file
View File

0
include/boost/typeof/template_encoding.hpp Executable file → Normal file
View File

0
include/boost/typeof/template_template_param.hpp Executable file → Normal file
View File

0
include/boost/typeof/type_encoding.hpp Executable file → Normal file
View File

0
include/boost/typeof/type_template_param.hpp Executable file → Normal file
View File

61
include/boost/typeof/typeof.hpp Executable file → Normal file
View File

@ -15,7 +15,7 @@
#if defined(__COMO__)
# ifdef __GNUG__
# ifndef(BOOST_TYPEOF_EMULATION)
# ifndef BOOST_TYPEOF_EMULATION
# ifndef BOOST_TYPEOF_NATIVE
# define BOOST_TYPEOF_NATIVE
# endif
@ -65,7 +65,7 @@
# endif
# define BOOST_TYPEOF_KEYWORD __typeof__
# else
# error typeof emulation is not supported
# define BOOST_TYPEOF_EMULATION_UNSUPPORTED
# endif
# else // 9.x
# ifndef BOOST_TYPEOF_EMULATION
@ -75,7 +75,22 @@
# define BOOST_TYPEOF_KEYWORD __typeof__
# endif
# endif
#elif defined __CODEGEARC__
# ifndef BOOST_TYPEOF_EMULATION
# ifndef BOOST_TYPEOF_NATIVE
# define BOOST_TYPEOF_EMULATION_UNSUPPORTED
# endif
# else
# define BOOST_TYPEOF_EMULATION_UNSUPPORTED
# endif
#elif defined __BORLANDC__
# ifndef BOOST_TYPEOF_EMULATION
# ifndef BOOST_TYPEOF_NATIVE
# define BOOST_TYPEOF_EMULATION_UNSUPPORTED
# endif
# else
# define BOOST_TYPEOF_EMULATION_UNSUPPORTED
# endif
#elif defined __DMC__
# ifndef BOOST_TYPEOF_EMULATION
# ifndef BOOST_TYPEOF_NATIVE
@ -95,24 +110,21 @@
# else
# error typeof emulation is not supported
# endif
# elif (_MSC_VER >= 1310) // 7.1, 8.0
# elif (_MSC_VER >= 1310) // 7.1 ->
# ifndef BOOST_TYPEOF_EMULATION
# ifndef BOOST_TYPEOF_NATIVE
# define BOOST_TYPEOF_NATIVE
# ifndef _MSC_EXTENSIONS
# define BOOST_TYPEOF_EMULATION
# else
# define BOOST_TYPEOF_NATIVE
# endif
# endif
# endif
# ifdef BOOST_TYPEOF_NATIVE
# include <boost/typeof/msvc/typeof_impl.hpp>
# define MSVC_TYPEOF_HACK
# endif
/*# else // 8.0
# ifndef BOOST_TYPEOF_NATIVE
# ifndef BOOST_TYPEOF_EMULATION
# define BOOST_TYPEOF_EMULATION
# endif
# else
# error native typeof is not supported
# endif*/
# endif
#elif defined(__HP_aCC)
# ifndef BOOST_TYPEOF_NATIVE
# ifndef BOOST_TYPEOF_EMULATION
@ -143,7 +155,22 @@
# else
# error native typeof is not supported
# endif
#elif defined(__SUNPRO_CC)
# if (__SUNPRO_CC < 0x590 )
# ifdef BOOST_TYPEOF_NATIVE
# error native typeof is not supported
# endif
# ifndef BOOST_TYPEOF_EMULATION
# define BOOST_TYPEOF_EMULATION
# endif
# else
# ifndef BOOST_TYPEOF_EMULATION
# ifndef BOOST_TYPEOF_NATIVE
# define BOOST_TYPEOF_NATIVE
# endif
# define BOOST_TYPEOF_KEYWORD __typeof__
# endif
# endif
#else //unknown compiler
# ifndef BOOST_TYPEOF_NATIVE
# ifndef BOOST_TYPEOF_EMULATION
@ -163,7 +190,9 @@
#define BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()\
<boost/typeof/incr_registration_group.hpp>
#ifdef BOOST_TYPEOF_EMULATION
#ifdef BOOST_TYPEOF_EMULATION_UNSUPPORTED
# include <boost/typeof/unsupported.hpp>
#elif defined BOOST_TYPEOF_EMULATION
# define BOOST_TYPEOF_TEXT "using typeof emulation"
# include <boost/typeof/message.hpp>
# include <boost/typeof/typeof_impl.hpp>

0
include/boost/typeof/typeof_impl.hpp Executable file → Normal file
View File

View File

@ -0,0 +1,29 @@
// Copyright (C) 2010 Peder Holt
// 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_UNSUPPORTED_HPP_INCLUDED
#define BOOST_TYPEOF_UNSUPPORTED_HPP_INCLUDED
namespace boost { namespace type_of {
struct typeof_emulation_is_unsupported_on_this_compiler {};
}}
#define BOOST_TYPEOF(expr) boost::type_of::typeof_emulation_is_unsupported_on_this_compiler
#define BOOST_TYPEOF_TPL BOOST_TYPEOF
#define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \
struct name {\
typedef BOOST_TYPEOF_TPL(expr) type;\
};
#define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \
struct name {\
typedef BOOST_TYPEOF(expr) type;\
};
#define BOOST_TYPEOF_REGISTER_TYPE(x)
#define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params)
#endif

0
include/boost/typeof/vector.hpp Executable file → Normal file
View File

0
include/boost/typeof/vector100.hpp Executable file → Normal file
View File

0
include/boost/typeof/vector150.hpp Executable file → Normal file
View File

0
include/boost/typeof/vector200.hpp Executable file → Normal file
View File

0
include/boost/typeof/vector50.hpp Executable file → Normal file
View File

2
index.html Executable file → Normal file
View 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>

0
test/data_member.cpp Executable file → Normal file
View File

2
test/function.cpp Executable file → Normal file
View File

@ -6,3 +6,5 @@
BOOST_STATIC_ASSERT(boost::type_of::test<void()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<double(bool)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(...)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<float(int, ...)>::value);

16
test/function_binding.cpp Executable file → Normal file
View File

@ -7,8 +7,16 @@
#include <boost/type_traits/is_same.hpp>
#include <boost/static_assert.hpp>
int foo(double);
typedef int(&FREF)(double);
FREF fref = *foo;
int foo1(double);
int foo2(...);
int foo3(int, ...);
typedef int(&FREF1)(double);
typedef int(&FREF2)(...);
typedef int(&FREF3)(int, ...);
FREF1 fref1 = *foo1;
FREF2 fref2 = *foo2;
FREF3 fref3 = *foo3;
BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(fref), int(double)>::value));
BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(fref1), int(double)>::value));
BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(fref2), int(...)>::value));
BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(fref3), int(int,...)>::value));

17
test/function_ptr.cpp Executable file → Normal file
View File

@ -8,12 +8,19 @@ BOOST_STATIC_ASSERT(boost::type_of::test<double(*)()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<double(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(...)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(int, double, short, char*, bool, char, float, long, unsigned short, ...)>::value);
// check that const gets stripped from function pointer
int foo(double);
typedef int(*PTR)(double);
typedef const PTR CPTR;
CPTR cptr = foo;
int foo1(double);
int foo2(...);
typedef int(*PTR1)(double);
typedef int(*PTR2)(...);
typedef const PTR1 CPTR1;
typedef const PTR2 CPTR2;
CPTR1 cptr1 = foo1;
CPTR2 cptr2 = foo2;
BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(cptr), PTR>::value));
BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(cptr1), PTR1>::value));
BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(cptr2), PTR2>::value));

20
test/function_ptr_from_tpl.cpp Executable file → Normal file
View File

@ -6,15 +6,23 @@
#include <boost/type_traits/is_same.hpp>
#include <boost/static_assert.hpp>
void f()
{}
void f1() {}
void f2(...) {}
template<class T>
struct tpl
struct tpl1
{
typedef BOOST_TYPEOF_TPL(&f) type;
typedef BOOST_TYPEOF_TPL(&f1) type;
};
typedef void(*fun_type)();
template<class T>
struct tpl2
{
typedef BOOST_TYPEOF_TPL(&f2) type;
};
typedef void(*fun1_type)();
typedef void(*fun2_type)(...);
BOOST_STATIC_ASSERT((boost::is_same<tpl<void>::type, fun_type>::value));
BOOST_STATIC_ASSERT((boost::is_same<tpl1<void>::type, fun1_type>::value));
BOOST_STATIC_ASSERT((boost::is_same<tpl2<void>::type, fun2_type>::value));

2
test/function_ref.cpp Executable file → Normal file
View File

@ -6,3 +6,5 @@
BOOST_STATIC_ASSERT(boost::type_of::test<void(&)()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<int(&)(int, short)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<int(&)(...)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<int(&)(int,...)>::value);

0
test/member_function.cpp Executable file → Normal file
View File

0
test/modifiers.cpp Executable file → Normal file
View File

0
test/noncopyable.cpp Executable file → Normal file
View File

0
test/odr.hpp Executable file → Normal file
View File

0
test/odr1.cpp Executable file → Normal file
View File

0
test/odr2.cpp Executable file → Normal file
View File

0
test/odr_no_uns1.cpp Executable file → Normal file
View File

0
test/odr_no_uns1.hpp Executable file → Normal file
View File

0
test/odr_no_uns2.cpp Executable file → Normal file
View File

0
test/odr_no_uns2.hpp Executable file → Normal file
View File

0
test/std.cpp Executable file → Normal file
View File

0
test/template_dependent.cpp Executable file → Normal file
View File

0
test/template_enum.cpp Executable file → Normal file
View File

0
test/template_int.cpp Executable file → Normal file
View File

0
test/template_multiword.cpp Executable file → Normal file
View File

0
test/template_tpl.cpp Executable file → Normal file
View File

0
test/template_type.cpp Executable file → Normal file
View File

0
test/test.hpp Executable file → Normal file
View File

0
test/type.cpp Executable file → Normal file
View File

View 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.
# //