File indexing completed on 2025-01-18 09:30:52
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_FLYWEIGHT_DETAIL_PERFECT_FWD_HPP
0010 #define BOOST_FLYWEIGHT_DETAIL_PERFECT_FWD_HPP
0011
0012 #if defined(_MSC_VER)
0013 #pragma once
0014 #endif
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
0038 #include <boost/preprocessor/cat.hpp>
0039 #include <boost/preprocessor/repetition/enum.hpp>
0040 #include <boost/preprocessor/repetition/enum_params.hpp>
0041 #include <boost/preprocessor/seq/seq.hpp>
0042
0043 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0044 #include <utility>
0045 #endif
0046
0047 #define BOOST_FLYWEIGHT_FORWARD_FORWARD_AUX(z,n,_) \
0048 std::forward<BOOST_PP_CAT(T,n)>(BOOST_PP_CAT(t,n))
0049
0050 #define BOOST_FLYWEIGHT_FORWARD_FORWARD(n) \
0051 BOOST_PP_ENUM(n,BOOST_FLYWEIGHT_FORWARD_FORWARD_AUX,~)
0052
0053 #define BOOST_FLYWEIGHT_FORWARD_ENUM(n) BOOST_PP_ENUM_PARAMS(n,t)
0054
0055 #define BOOST_FLYWEIGHT_FORWARD_PASS(arg) arg
0056
0057 #define BOOST_FLYWEIGHT_FORWARD(args)\
0058 BOOST_PP_CAT(BOOST_FLYWEIGHT_FORWARD_,BOOST_PP_SEQ_HEAD(args))( \
0059 BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(args)))
0060
0061 #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)||\
0062 defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
0063
0064 #if !defined(BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS)
0065 #define BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS 5
0066 #endif
0067
0068 #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS<0
0069 #error BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS must be >=0
0070 #endif
0071
0072 #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS<=5
0073 #include <boost/flyweight/detail/pp_perfect_fwd.hpp>
0074 #else
0075 #include <boost/flyweight/detail/dyn_perfect_fwd.hpp>
0076 #endif
0077
0078 #else
0079
0080
0081
0082 #define BOOST_FLYWEIGHT_PERFECT_FWD(name,body) \
0083 template<typename... Args>name(Args&&... args) \
0084 body((PASS)(std::forward<Args>(args)...))
0085
0086 #define BOOST_FLYWEIGHT_PERFECT_FWD_WITH_ARGS \
0087 BOOST_FLYWEIGHT_PERFECT_FWD
0088
0089 #endif
0090 #endif