4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // pfto.hpp: workarounds for compilers which have problems supporting
11 // Partial Function Template Ordering (PFTO).
13 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
14 // Use, modification and distribution is subject to the Boost Software
15 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
18 // See http://www.boost.org for updates, documentation, and revision history.
19 // PFTO version is used to specify the last argument of certain functions
20 // Function it is used to support compilers that fail to support correct Partial
22 #include <boost/config.hpp>
24 // some compilers can use an exta argument and use function overloading
25 // to choose desired function. This extra argument is long in the default
26 // function implementation and int for the rest. The function is called
27 // with an int argument. This first attempts to match functions with an
28 // int argument before the default one (with a long argument). This is
29 // known to function with VC 6.0. On other compilers this fails (Borland)
30 // or causes other problems (GCC). note: this
32 #if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
33 #define BOOST_PFTO long
38 // here's another approach. Rather than use a default function - make sure
39 // there is no default at all by requiring that all function invocations
40 // have a "wrapped" argument type. This solves a problem with VC 6.0
41 // (and perhaps others) while implementing templated constructors.
48 operator const T & (){
51 pfto_wrapper (const T & rhs) : t(rhs) {}
55 pfto_wrapper<T> make_pfto_wrapper(const T & t, BOOST_PFTO int){
56 return pfto_wrapper<T>(t);
60 pfto_wrapper<T> make_pfto_wrapper(const pfto_wrapper<T> & t, int){
66 #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
67 #define BOOST_PFTO_WRAPPER(T) boost::pfto_wrapper<T>
68 #define BOOST_MAKE_PFTO_WRAPPER(t) boost::make_pfto_wrapper(t, 0)
70 #define BOOST_PFTO_WRAPPER(T) T
71 #define BOOST_MAKE_PFTO_WRAPPER(t) t
74 #endif // BOOST_PFTO_HPP