Compare commits

...

50 Commits

Author SHA1 Message Date
080f05ea46 Squash-merge branch feature/pull-11 2018-01-13 20:46:25 +02:00
0047815f4a Merge branch 'feature/ignore-deprecated' of https://github.com/DanielaE/boost.typeof into develop 2017-11-22 01:41:04 +02:00
e789dbdcbe Merge branch 'develop' 2017-11-04 20:33:26 +02:00
e9f4579047 Test typeof instead of smart_ptr :-/ 2017-11-04 16:26:08 +02:00
ec502afe5d Update .travis.yml 2017-11-04 00:36:52 +02:00
a9298ee94f Add import testing ; to test/Jamfile 2017-11-04 00:36:29 +02:00
d6f7132800 Merge pull request #10 from eldiener/develop
Remove executable attribute.
2017-11-03 23:39:24 +02:00
05ad6402ef Remove executable attribute. 2017-09-17 08:27:46 -04:00
8475a449d3 Appveyor config referenced Travis variables 2017-08-10 09:19:30 -07:00
a506733d99 Add appveyor.yml CI script. 2017-08-10 08:23:27 -07:00
be4cdd3a29 Merge branch 'develop'
Conflicts:
	include/boost/typeof/msvc/typeof_impl.hpp
	include/boost/typeof/typeof.hpp
2017-04-24 17:11:43 +03:00
5d737d61e5 conditionally ignore testcases for removed library features
Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-04-19 19:31:39 +02:00
733e1e94c8 Remove trailing whitespace 2017-04-16 18:03:52 +03:00
2b4df4f09f Merge branch 'DanielaE-feature/msvc-option-permissive-' into develop 2017-04-16 18:02:39 +03:00
12e1fe615a enable use of msvc compiler option /permissive-
The compiler hack used to emulate __typeof__ on msvc no longer works when compiler option /permissive- is engaged. Rather than preying on a compiler bug take advantage of modern c++ instead.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-04-16 08:51:30 +02:00
681499bba4 Merge branch 'pgroke-dt-z_OS_XL_C++_support' into develop 2017-04-16 01:27:37 +03:00
7db26fbf83 Merge branch 'z_OS_XL_C++_support' of https://github.com/pgroke-dt/typeof into pgroke-dt-z_OS_XL_C++_support 2017-04-16 01:25:32 +03:00
64ad04d3eb Merge branch 'awulkiew-fix/msc_clang' into develop 2017-04-16 01:19:39 +03:00
72e3e5ac18 Merge branch 'fix/msc_clang' of https://github.com/awulkiew/typeof into awulkiew-fix/msc_clang 2017-04-16 01:17:05 +03:00
ec9d092345 Add c++03, g++ 4.6, clang-3.4 to Travis 2017-04-16 00:22:27 +03:00
ab7073f32d Add .travis.yml 2017-04-16 00:08:05 +03:00
03ae4b3465 support for IBM XL C/C++ compiler family __typeof__ 2017-02-21 22:54:41 +01:00
d8b8af69ac Add, and update, documentation build targets. 2016-10-07 23:07:37 -05:00
4994d5be13 Fix compilation error with MSC+Clang - check defined(__clang__) explicitly. 2016-03-16 01:55:41 +01:00
c394d0a5ae Fix outdated path to boostbook css. 2015-12-21 22:32:05 -06:00
5bbb552f28 Merge pull request #2 from danieljames/metadata
Create metadata file.
2015-01-25 20:27:48 +02:00
5bf1a089bd Add metadata file. 2014-08-18 15:12:05 +01:00
4e34737b9c TypeOf: Fix if/elif chain after msvc 6/7 removal.
[SVN r85925]
2013-09-26 06:52:33 +00:00
8092dd0003 TypeOf: Remove obsolete MSVC version checks
[SVN r85920]
2013-09-25 21:15:54 +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
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
76 changed files with 455 additions and 117 deletions

199
.travis.yml Normal file
View File

@ -0,0 +1,199 @@
# Copyright 2016, 2017 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
language: cpp
sudo: false
python: "2.7"
branches:
only:
- master
- develop
- /feature\/.*/
env:
matrix:
- BOGUS_JOB=true
matrix:
exclude:
- env: BOGUS_JOB=true
include:
- os: linux
compiler: g++
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11
- os: linux
compiler: g++-4.7
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.7
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-4.8
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.8
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-4.9
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.9
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-5
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- g++-5
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-6
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- g++-6
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-7
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
- os: linux
compiler: clang++-3.5
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.5
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
- os: linux
compiler: clang++-3.6
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.6
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
- os: linux
compiler: clang++-3.7
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
- os: linux
compiler: clang++-3.8
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.8
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
- os: linux
compiler: clang++-3.9
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.9
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.9
- os: linux
compiler: clang++-4.0
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-4.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- os: linux
compiler: clang++-5.0
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-5.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
- os: osx
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- cd ..
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- cp -r $TRAVIS_BUILD_DIR/* libs/typeof
- python tools/boostdep/depinst/depinst.py typeof
- ./bootstrap.sh
- ./b2 headers
script:
- |-
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
- ./b2 libs/typeof/test toolset=$TOOLSET cxxstd=$CXXSTD
notifications:
email:
on_success: always

62
appveyor.yml Normal file
View File

@ -0,0 +1,62 @@
# Copyright 2016 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
version: 1.0.{build}-{branch}
shallow_clone: true
branches:
only:
- master
- develop
platform:
- x64
environment:
matrix:
- ARGS: --toolset=msvc-9.0 address-model=32
- ARGS: --toolset=msvc-10.0 address-model=32
- ARGS: --toolset=msvc-11.0 address-model=32
- ARGS: --toolset=msvc-12.0 address-model=32
- ARGS: --toolset=msvc-14.0 address-model=32
- ARGS: --toolset=msvc-12.0 address-model=64
- ARGS: --toolset=msvc-14.0 address-model=64
- ARGS: --toolset=msvc-14.0 address-model=64 cxxflags=-std:c++latest
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARGS: --toolset=msvc-14.1 address-model=64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARGS: --toolset=msvc-14.1 address-model=32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest
- ARGS: --toolset=gcc address-model=64
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
- ARGS: --toolset=gcc address-model=64 cxxflags=-std=gnu++1z
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
- ARGS: --toolset=gcc address-model=32
PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
- ARGS: --toolset=gcc address-model=32 linkflags=-Wl,-allow-multiple-definition
PATH: C:\MinGW\bin;%PATH%
install:
- cd ..
- git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\typeof\
- python tools/boostdep/depinst/depinst.py typeof
- bootstrap
- b2 headers
build: off
test_script:
- cd libs\config\test
- ..\..\..\b2 config_info_travis_install %ARGS%
- config_info_travis
- cd ..\..\typeof\test
- ..\..\..\b2 -j3 %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES

View File

@ -0,0 +1,34 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Copyright (C) 2017 Daniela Engert
// 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_DECLTYPE_HPP_INCLUDED
# define BOOST_TYPEOF_DECLTYPE_HPP_INCLUDED
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/remove_reference.hpp>
namespace boost { namespace type_of {
template<typename T>
using remove_cv_ref_t = typename remove_cv<typename remove_reference<T>::type>::type;
}}
#define BOOST_TYPEOF(expr) boost::type_of::remove_cv_ref_t<decltype(expr)>
#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 //BOOST_TYPEOF_DECLTYPE_HPP_INCLUDED

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

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

View File

@ -15,9 +15,7 @@
# include <boost/type_traits/is_function.hpp>
# include <boost/utility/enable_if.hpp>
# if BOOST_WORKAROUND(BOOST_MSVC,>=1310)
# include <typeinfo>
# endif
# include <typeinfo>
namespace boost
{
@ -25,7 +23,7 @@ namespace boost
{
//Compile time constant code
# if BOOST_WORKAROUND(BOOST_MSVC,>=1300) && defined(_MSC_EXTENSIONS)
# if defined(_MSC_EXTENSIONS)
template<int N> struct the_counter;
template<typename T,int N = 5/*for similarity*/>
@ -85,26 +83,7 @@ namespace boost
//Typeof code
# if BOOST_WORKAROUND(BOOST_MSVC,==1300)
template<typename ID>
struct msvc_extract_type
{
template<bool>
struct id2type_impl;
typedef id2type_impl<true> id2type;
};
template<typename T, typename ID>
struct msvc_register_type : msvc_extract_type<ID>
{
template<>
struct id2type_impl<true> //VC7.0 specific bugfeature
{
typedef T type;
};
};
#elif BOOST_WORKAROUND(BOOST_MSVC,>=1400)
# if BOOST_WORKAROUND(BOOST_MSVC,>=1400)
struct msvc_extract_type_default_param {};
template<typename ID, typename T = msvc_extract_type_default_param>
@ -153,60 +132,7 @@ namespace boost
};
};
# endif
// EAN: preprocess this block out on advice of Peder Holt
// to eliminate errors in type_traits/common_type.hpp
# if 0 //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;
@ -242,7 +168,6 @@ 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&);
@ -250,10 +175,6 @@ struct name {\
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);
@ -264,19 +185,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

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

@ -34,8 +34,7 @@ BOOST_TYPEOF_REGISTER_TYPE(long double)
BOOST_TYPEOF_REGISTER_TYPE(wchar_t)
#endif
#if (defined(BOOST_MSVC) && (BOOST_MSVC == 1200)) \
|| (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \
#if (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \
|| (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER == 1200))
BOOST_TYPEOF_REGISTER_TYPE(unsigned __int8)
BOOST_TYPEOF_REGISTER_TYPE(__int8)

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

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

@ -10,8 +10,10 @@
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifndef BOOST_NO_CXX98_FUNCTION_BASE
BOOST_TYPEOF_REGISTER_TEMPLATE(std::unary_function, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::binary_function, 3)
#endif//BOOST_NO_CXX98_FUNCTION_BASE
BOOST_TYPEOF_REGISTER_TEMPLATE(std::plus, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::minus, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::multiplies, 1)
@ -30,6 +32,8 @@ BOOST_TYPEOF_REGISTER_TEMPLATE(std::logical_not, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::unary_negate, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::binary_negate, 1)
#ifndef BOOST_NO_CXX98_BINDERS
#if defined(__MWERKS__) && defined(_MSL_EXTENDED_BINDERS)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::binder1st, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::binder2nd, 2)
@ -52,4 +56,6 @@ BOOST_TYPEOF_REGISTER_TEMPLATE(std::mem_fun1_ref_t, 3)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::const_mem_fun1_ref_t, 3)
#endif//BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#endif//BOOST_NO_CXX98_BINDERS
#endif//BOOST_TYPEOF_STD_functional_hpp_INCLUDED

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

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

@ -12,6 +12,8 @@
BOOST_TYPEOF_REGISTER_TEMPLATE(std::allocator, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::raw_storage_iterator, 2)
#ifndef BOOST_NO_AUTO_PTR
BOOST_TYPEOF_REGISTER_TEMPLATE(std::auto_ptr, 1)
#endif//BOOST_NO_AUTO_PTR
#endif//BOOST_TYPEOF_STD_memory_hpp_INCLUDED

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

View File

@ -13,7 +13,16 @@
# error both typeof emulation and native mode requested
#endif
#if defined(__COMO__)
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1900) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_TYPEOF_EMULATION)
# define BOOST_TYPEOF_DECLTYPE
# ifndef BOOST_TYPEOF_NATIVE
# define BOOST_TYPEOF_NATIVE
# endif
#elif defined(__COMO__)
# ifdef __GNUG__
# ifndef BOOST_TYPEOF_EMULATION
# ifndef BOOST_TYPEOF_NATIVE
@ -49,7 +58,7 @@
# endif
# endif
#elif defined(__GNUC__)
#elif defined(__GNUC__) || defined(__clang__)
# ifndef BOOST_TYPEOF_EMULATION
# ifndef BOOST_TYPEOF_NATIVE
# define BOOST_TYPEOF_NATIVE
@ -100,17 +109,7 @@
# define MSVC_TYPEOF_HACK
# endif
#elif defined(_MSC_VER)
# if (_MSC_VER <= 1300) // 6.5, 7.0
# ifndef BOOST_TYPEOF_EMULATION
# ifndef BOOST_TYPEOF_NATIVE
# define BOOST_TYPEOF_NATIVE
# endif
# include <boost/typeof/msvc/typeof_impl.hpp>
# define MSVC_TYPEOF_HACK
# else
# error typeof emulation is not supported
# endif
# elif (_MSC_VER >= 1310) // 7.1 ->
# if (_MSC_VER >= 1310) // 7.1 ->
# ifndef BOOST_TYPEOF_EMULATION
# ifndef BOOST_TYPEOF_NATIVE
# ifndef _MSC_EXTENSIONS
@ -171,6 +170,13 @@
# define BOOST_TYPEOF_KEYWORD __typeof__
# endif
# endif
#elif defined(__IBM__TYPEOF__)
# ifndef BOOST_TYPEOF_EMULATION
# ifndef BOOST_TYPEOF_NATIVE
# define BOOST_TYPEOF_NATIVE
# endif
# define BOOST_TYPEOF_KEYWORD __typeof__
# endif
#else //unknown compiler
# ifndef BOOST_TYPEOF_NATIVE
# ifndef BOOST_TYPEOF_EMULATION
@ -206,7 +212,11 @@
#elif defined(BOOST_TYPEOF_NATIVE)
# define BOOST_TYPEOF_TEXT "using native typeof"
# include <boost/typeof/message.hpp>
# include <boost/typeof/native.hpp>
# ifdef BOOST_TYPEOF_DECLTYPE
# include <boost/typeof/decltype.hpp>
# else
# include <boost/typeof/native.hpp>
# endif
#else
# error typeof configuration error
#endif

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

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

View File

@ -5,6 +5,7 @@
# Boost Typeof Library test Jamfile
import testing ;
import set ;
# The special requirement is not ported yet.

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

View File

@ -0,0 +1,74 @@
// Copyright (C) 2018 Tobias Loew
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include <boost/config.hpp>
#include <boost/config/pragma_message.hpp>
#if defined(BOOST_NO_CXX11_LAMBDAS)
BOOST_PRAGMA_MESSAGE("Skipping test due to BOOST_NO_CXX11_LAMBDAS")
int main() {}
#elif defined(BOOST_NO_CXX11_AUTO_DECLARATIONS)
BOOST_PRAGMA_MESSAGE("Skipping test due to BOOST_NO_CXX11_AUTO_DECLARATIONS")
int main() {}
#else
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
namespace detail {
template<class T> inline T& deref(T& r) {
return r;
}
template<class T>
struct wrapper {
typedef T type;
};
template<class T> wrapper<T> wrap(T&);
};
BOOST_TYPEOF_REGISTER_TEMPLATE(::detail::wrapper, 1)
void test_typeof_in_lambda() {
// Visual Studio 2015 (BOOST_MSVC == 1900) had an internal compiler error with Boost 1.65 and 1.66 when using BOOST_SCOPE_EXIT inside a lambda
// the error was due to a change of include in boost/typeof/typeof.hpp (<boost/typeof/decltype.hpp> instead of <boost/typeof/native.hpp>)
// This test is an more or less minimal extract from the BOOST_SCOPE_EXIT macro expansions
// worked also with VS 2015 in version 1.65/1.66
int n;
typedef BOOST_TYPEOF(::detail::wrap(::detail::deref(n))) n_type_wrapped;
typedef n_type_wrapped::type n_type;
int test;
auto check_property = [&n,&test]() {
// internal compiler error with VS 2015 in version 1.65/1.66
// minimal extract from
//BOOST_SCOPE_EXIT(test) {
// test = 42;
//}BOOST_SCOPE_EXIT_END
// this compiles always (as long as the one before outside the lambda has the same name)
typedef BOOST_TYPEOF(::detail::wrap(::detail::deref(n))) n_type_wrapped;
typedef n_type_wrapped::type n_type;
// this fails with internal compiler error with VS 2015 in version 1.65/1.66
typedef BOOST_TYPEOF(::detail::wrap(::detail::deref(test))) test_type_wrapped;
typedef test_type_wrapped::type test_type;
};
}
int main() {
test_typeof_in_lambda();
return 0;
}
#endif

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

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

@ -42,8 +42,10 @@ BOOST_STATIC_ASSERT(boost::type_of::test<bitset<10> >::value);
// function objects
#ifndef BOOST_NO_CXX98_FUNCTION_BASE
BOOST_STATIC_ASSERT((boost::type_of::test<unary_function<int, int> >::value));
BOOST_STATIC_ASSERT((boost::type_of::test<binary_function<int, int, int> >::value));
#endif//BOOST_NO_CXX98_FUNCTION_BASE
BOOST_STATIC_ASSERT(boost::type_of::test<plus<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<minus<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<multiplies<int> >::value);
@ -61,8 +63,10 @@ BOOST_STATIC_ASSERT(boost::type_of::test<logical_or<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<logical_not<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<unary_negate<negate<int> > >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<binary_negate<less<int> > >::value);
#ifndef BOOST_NO_CXX98_BINDERS
BOOST_STATIC_ASSERT(boost::type_of::test<binder1st<less<int> > >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<binder2nd<less<int> > >::value);
#endif//BOOST_NO_CXX98_BINDERS
// valarray

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