]> git.donarmstrong.com Git - rsem.git/blob - boost/format/detail/msvc_disambiguater.hpp
RSEM Source Codes
[rsem.git] / boost / format / detail / msvc_disambiguater.hpp
1 // ----------------------------------------------------------------------------
2 // msvc_disambiguater.hpp : msvc workarounds. (for put_{head|last} overloads)
3 //               the trick was described in boost's list  by Aleksey Gurtovoy
4 // ----------------------------------------------------------------------------
5
6 //  Copyright Samuel Krempp 2003. Use, modification, and distribution are
7 //  subject to the Boost Software License, Version 1.0. (See accompanying
8 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9
10 // see http://www.boost.org/libs/format for library home page
11
12 // ----------------------------------------------------------------------------
13
14 #ifndef BOOST_MSVC_DISAMBIGUATER_HPP
15 #define BOOST_MSVC_DISAMBIGUATER_HPP
16
17 #if BOOST_WORKAROUND( BOOST_MSVC, <= 1300) || \
18     BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
19    // this whole header is specifically for msvc up to 7.0
20
21 #include <boost/format/group.hpp>
22 #include <ostream>
23
24 namespace boost {
25 namespace io {
26 namespace detail {
27
28 template< class Ch, class Tr, class T >
29 struct disambiguater
30 {
31    template< typename U >
32    static void put_head(BOOST_IO_STD basic_ostream<Ch, Tr>& os, group1<U> const& x, long)
33    {
34        os << group_head(x.a1_); 
35    }
36    static void put_head(BOOST_IO_STD basic_ostream<Ch, Tr>& os, T const& x, int)
37    {
38    }
39    template< typename U >
40    static void put_last(BOOST_IO_STD basic_ostream<Ch, Tr>& os, group1<U> const& x, long)
41    {
42        os << group_last(x.a1_); 
43    }
44    static void put_last(BOOST_IO_STD basic_ostream<Ch, Tr>& os, T const& x, int)
45    {
46      os << x;
47    }
48 };
49
50 } // namespace detail
51 } // namespace io
52 } // namespace boost
53
54 #endif // -BOOST_MSVC
55
56 #endif // -BOOST_MSVC_DISAMBIGUATER_HPP