]> git.lyx.org Git - lyx.git/blob - boost/boost/format/msvc_disambiguater.hpp
update boost to pre-1.30.0
[lyx.git] / boost / boost / format / msvc_disambiguater.hpp
1 // -*- C++ -*-
2 //  Boost general library 'format'   ---------------------------
3 //  See http://www.boost.org for updates, documentation, and revision history.
4
5 //  (C) Samuel Krempp 2001
6 //                  krempp@crans.ens-cachan.fr
7 //  Permission to copy, use, modify, sell and
8 //  distribute this software is granted provided this copyright notice appears
9 //  in all copies. This software is provided "as is" without express or implied
10 //  warranty, and with no claim as to its suitability for any purpose.
11
12 // ideas taken from RĂ¼diger Loos's format class
13 // and Karl Nelson's ofstream
14
15 // ----------------------------------------------------------------------------
16 // msvc_disambiguater.hpp : msvc workarounds. (for put_{head|last} overloads)
17 //                          the trick was described in boost's list  by Aleksey Gurtovoy
18 // ----------------------------------------------------------------------------
19
20
21 #ifndef BOOST_MSVC_DISAMBIGUATER_HPP
22 #define BOOST_MSVC_DISAMBIGUATER_HPP
23
24 #if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 // this whole header is specifically for msvc
25
26 #include "boost/format/group.hpp"
27 #include <ostream>
28
29 namespace boost {
30 namespace io {
31 namespace detail {
32
33 template< class Ch, class Tr, class T >
34 struct disambiguater
35 {
36    template< typename U >
37    static void put_head(BOOST_IO_STD basic_ostream<Ch, Tr>& os, group1<U> const& x, long)
38    {
39        os << group_head(x.a1_); 
40    }
41    static void put_head(BOOST_IO_STD basic_ostream<Ch, Tr>& os, T const& x, int)
42    {
43    }
44    template< typename U >
45    static void put_last(BOOST_IO_STD basic_ostream<Ch, Tr>& os, group1<U> const& x, long)
46    {
47        os << group_last(x.a1_); 
48    }
49    static void put_last(BOOST_IO_STD basic_ostream<Ch, Tr>& os, T const& x, int)
50    {
51      os << x;
52    }
53 };
54
55 } // namespace detail
56 } // namespace io
57 } // namespace boost
58
59 #endif // -BOOST_MSVC
60
61 #endif // -BOOST_MSVC_DISAMBIGUATER_HPP