Chris@101: /* Copyright 2006-2014 Joaquin M Lopez Munoz. Chris@16: * Distributed under the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or copy at Chris@16: * http://www.boost.org/LICENSE_1_0.txt) Chris@16: * Chris@16: * See http://www.boost.org/libs/flyweight for library home page. Chris@16: */ Chris@16: Chris@101: #ifndef BOOST_FLYWEIGHT_DETAIL_PP_PERFECT_FWD_HPP Chris@101: #define BOOST_FLYWEIGHT_DETAIL_PP_PERFECT_FWD_HPP Chris@101: Chris@101: #if defined(_MSC_VER) Chris@101: #pragma once Chris@101: #endif Chris@101: Chris@101: #include Chris@101: Chris@101: #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) Chris@101: Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_0(name,body) \ Chris@101: name()body((FORWARD)(0)) Chris@16: Chris@16: #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS>=1 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_1(name,body) \ Chris@101: template name(T0&& t0)body((FORWARD)(1)) Chris@16: #endif Chris@16: Chris@16: #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS>=2 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_2(name,body) \ Chris@101: template name(T0&& t0,T1&& t1)body((FORWARD)(2)) Chris@16: #endif Chris@16: Chris@16: #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS>=3 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_3(name,body) \ Chris@101: template name(T0&& t0,T1&& t1,T2&& t2)body((FORWARD)(3)) Chris@16: #endif Chris@16: Chris@16: #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS>=4 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_4(name,body) \ Chris@101: template name(T0&& t0,T1&& t1,T2&& t2,T3&& t3)body((FORWARD)(4)) Chris@16: #endif Chris@16: Chris@16: #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS>=5 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_5(name,body) \ Chris@101: template name(T0&& t0,T1&& t1,T2&& t2,T3&& t3,T4&& t4)body((FORWARD)(5)) Chris@101: #endif Chris@101: Chris@101: #else Chris@101: Chris@101: /* no rvalue refs -> [const] Tn& overloads */ Chris@101: Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_0(name,body) \ Chris@101: name()body((ENUM)(0)) Chris@101: Chris@101: #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS>=1 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_1(name,body) \ Chris@101: template name(T0& t0)body((ENUM)(1))\ Chris@101: template name(const T0& t0)body((ENUM)(1)) Chris@101: #endif Chris@101: Chris@101: #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS>=2 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_2(name,body) \ Chris@101: template name(T0& t0,T1& t1)body((ENUM)(2))\ Chris@101: template name(T0& t0,const T1& t1)body((ENUM)(2))\ Chris@101: template name(const T0& t0,T1& t1)body((ENUM)(2))\ Chris@101: template name(const T0& t0,const T1& t1)body((ENUM)(2)) Chris@101: #endif Chris@101: Chris@101: #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS>=3 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_3(name,body) \ Chris@101: template name(T0& t0,T1& t1,T2& t2)body((ENUM)(3))\ Chris@101: template name(T0& t0,T1& t1,const T2& t2)body((ENUM)(3))\ Chris@101: template name(T0& t0,const T1& t1,T2& t2)body((ENUM)(3))\ Chris@101: template name(T0& t0,const T1& t1,const T2& t2)body((ENUM)(3))\ Chris@101: template name(const T0& t0,T1& t1,T2& t2)body((ENUM)(3))\ Chris@101: template name(const T0& t0,T1& t1,const T2& t2)body((ENUM)(3))\ Chris@101: template name(const T0& t0,const T1& t1,T2& t2)body((ENUM)(3))\ Chris@101: template name(const T0& t0,const T1& t1,const T2& t2)body((ENUM)(3)) Chris@101: #endif Chris@101: Chris@101: #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS>=4 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_4(name,body) \ Chris@101: template name(T0& t0,T1& t1,T2& t2,T3& t3)body((ENUM)(4))\ Chris@101: template name(T0& t0,T1& t1,T2& t2,const T3& t3)body((ENUM)(4))\ Chris@101: template name(T0& t0,T1& t1,const T2& t2,T3& t3)body((ENUM)(4))\ Chris@101: template name(T0& t0,T1& t1,const T2& t2,const T3& t3)body((ENUM)(4))\ Chris@101: template name(T0& t0,const T1& t1,T2& t2,T3& t3)body((ENUM)(4))\ Chris@101: template name(T0& t0,const T1& t1,T2& t2,const T3& t3)body((ENUM)(4))\ Chris@101: template name(T0& t0,const T1& t1,const T2& t2,T3& t3)body((ENUM)(4))\ Chris@101: template name(T0& t0,const T1& t1,const T2& t2,const T3& t3)body((ENUM)(4))\ Chris@101: template name(const T0& t0,T1& t1,T2& t2,T3& t3)body((ENUM)(4))\ Chris@101: template name(const T0& t0,T1& t1,T2& t2,const T3& t3)body((ENUM)(4))\ Chris@101: template name(const T0& t0,T1& t1,const T2& t2,T3& t3)body((ENUM)(4))\ Chris@101: template name(const T0& t0,T1& t1,const T2& t2,const T3& t3)body((ENUM)(4))\ Chris@101: template name(const T0& t0,const T1& t1,T2& t2,T3& t3)body((ENUM)(4))\ Chris@101: template name(const T0& t0,const T1& t1,T2& t2,const T3& t3)body((ENUM)(4))\ Chris@101: template name(const T0& t0,const T1& t1,const T2& t2,T3& t3)body((ENUM)(4))\ Chris@101: template name(const T0& t0,const T1& t1,const T2& t2,const T3& t3)body((ENUM)(4)) Chris@101: #endif Chris@101: Chris@101: #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS>=5 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_5(name,body) \ Chris@101: template name(T0& t0,T1& t1,T2& t2,T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,T1& t1,T2& t2,T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,T1& t1,T2& t2,const T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,T1& t1,T2& t2,const T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,T1& t1,const T2& t2,T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,T1& t1,const T2& t2,T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,T1& t1,const T2& t2,const T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,T1& t1,const T2& t2,const T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,const T1& t1,T2& t2,T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,const T1& t1,T2& t2,T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,const T1& t1,T2& t2,const T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,const T1& t1,T2& t2,const T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,const T1& t1,const T2& t2,T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,const T1& t1,const T2& t2,T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,const T1& t1,const T2& t2,const T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(T0& t0,const T1& t1,const T2& t2,const T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,T1& t1,T2& t2,T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,T1& t1,T2& t2,T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,T1& t1,T2& t2,const T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,T1& t1,T2& t2,const T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,T1& t1,const T2& t2,T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,T1& t1,const T2& t2,T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,T1& t1,const T2& t2,const T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,T1& t1,const T2& t2,const T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,const T1& t1,T2& t2,T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,const T1& t1,T2& t2,T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,const T1& t1,T2& t2,const T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,const T1& t1,T2& t2,const T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,const T1& t1,const T2& t2,T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,const T1& t1,const T2& t2,T3& t3,const T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,const T1& t1,const T2& t2,const T3& t3,T4& t4)body((ENUM)(5))\ Chris@101: template name(const T0& t0,const T1& t1,const T2& t2,const T3& t3,const T4& t4)body((ENUM)(5)) Chris@101: #endif Chris@101: Chris@16: #endif Chris@16: Chris@16: #if BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS==0 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_WITH_ARGS(name,body) Chris@16: #elif BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS==1 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_WITH_ARGS(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_1(name,body) Chris@16: #elif BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS==2 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_WITH_ARGS(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_1(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_2(name,body) Chris@16: #elif BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS==3 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_WITH_ARGS(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_1(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_2(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_3(name,body) Chris@16: #elif BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS==4 Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_WITH_ARGS(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_1(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_2(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_3(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_4(name,body) Chris@16: #else /* BOOST_FLYWEIGHT_LIMIT_PERFECT_FWD_ARGS==5 */ Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD_WITH_ARGS(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_1(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_2(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_3(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_4(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_5(name,body) Chris@16: #endif Chris@16: Chris@101: #define BOOST_FLYWEIGHT_PERFECT_FWD(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_0(name,body) \ Chris@101: BOOST_FLYWEIGHT_PERFECT_FWD_WITH_ARGS(name,body) Chris@16: Chris@16: #endif