From: <arn...@us...> - 2007-12-22 22:38:18
|
Revision: 948 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=948&view=rev Author: arnetheduck Date: 2007-12-22 14:38:16 -0800 (Sat, 22 Dec 2007) Log Message: ----------- boost 1.34.1 Modified Paths: -------------- dcplusplus/trunk/boost/boost/archive/basic_text_oprimitive.hpp dcplusplus/trunk/boost/boost/archive/basic_xml_archive.hpp dcplusplus/trunk/boost/boost/archive/detail/iserializer.hpp dcplusplus/trunk/boost/boost/archive/detail/oserializer.hpp dcplusplus/trunk/boost/boost/date_time/date_generators.hpp dcplusplus/trunk/boost/boost/date_time/time_resolution_traits.hpp dcplusplus/trunk/boost/boost/detail/atomic_count_gcc.hpp dcplusplus/trunk/boost/boost/function.hpp dcplusplus/trunk/boost/boost/functional/hash/hash.hpp dcplusplus/trunk/boost/boost/graph/relax.hpp dcplusplus/trunk/boost/boost/iostreams/char_traits.hpp dcplusplus/trunk/boost/boost/iostreams/checked_operations.hpp dcplusplus/trunk/boost/boost/iostreams/code_converter.hpp dcplusplus/trunk/boost/boost/iostreams/compose.hpp dcplusplus/trunk/boost/boost/iostreams/detail/adapter/concept_adapter.hpp dcplusplus/trunk/boost/boost/iostreams/detail/adapter/direct_adapter.hpp dcplusplus/trunk/boost/boost/iostreams/detail/adapter/mode_adapter.hpp dcplusplus/trunk/boost/boost/iostreams/detail/adapter/non_blocking_adapter.hpp dcplusplus/trunk/boost/boost/iostreams/detail/adapter/range_adapter.hpp dcplusplus/trunk/boost/boost/iostreams/detail/resolve.hpp dcplusplus/trunk/boost/boost/iostreams/detail/streambuf/direct_streambuf.hpp dcplusplus/trunk/boost/boost/iostreams/detail/streambuf/indirect_streambuf.hpp dcplusplus/trunk/boost/boost/iostreams/device/file.hpp dcplusplus/trunk/boost/boost/iostreams/device/file_descriptor.hpp dcplusplus/trunk/boost/boost/iostreams/device/mapped_file.hpp dcplusplus/trunk/boost/boost/iostreams/device/null.hpp dcplusplus/trunk/boost/boost/iostreams/filter/aggregate.hpp dcplusplus/trunk/boost/boost/iostreams/filter/gzip.hpp dcplusplus/trunk/boost/boost/iostreams/filter/line.hpp dcplusplus/trunk/boost/boost/iostreams/filter/zlib.hpp dcplusplus/trunk/boost/boost/iostreams/restrict.hpp dcplusplus/trunk/boost/boost/limits.hpp dcplusplus/trunk/boost/boost/numeric/interval/detail/ppc_rounding_control.hpp dcplusplus/trunk/boost/boost/operators.hpp dcplusplus/trunk/boost/boost/python/exec.hpp dcplusplus/trunk/boost/boost/python/module_init.hpp dcplusplus/trunk/boost/boost/regex/v4/basic_regex.hpp dcplusplus/trunk/boost/boost/spirit/iterator/file_iterator.hpp dcplusplus/trunk/boost/boost/spirit/iterator/impl/file_iterator.ipp dcplusplus/trunk/boost/boost/tr1/detail/config.hpp dcplusplus/trunk/boost/boost/version.hpp dcplusplus/trunk/boost/boost/xpressive/detail/core/state.hpp dcplusplus/trunk/boost/boost/xpressive/detail/dynamic/dynamic.hpp Modified: dcplusplus/trunk/boost/boost/archive/basic_text_oprimitive.hpp =================================================================== --- dcplusplus/trunk/boost/boost/archive/basic_text_oprimitive.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/archive/basic_text_oprimitive.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -89,8 +89,10 @@ void save(const bool t){ // trap usage of invalid uninitialized boolean which would // otherwise crash on load. +#ifndef NDEBUG int i = t; assert(0 == i || 1 == i); +#endif if(os.fail()) boost::throw_exception(archive_exception(archive_exception::stream_error)); os << t; Modified: dcplusplus/trunk/boost/boost/archive/basic_xml_archive.hpp =================================================================== --- dcplusplus/trunk/boost/boost/archive/basic_xml_archive.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/archive/basic_xml_archive.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -36,7 +36,7 @@ xml_archive_tag_mismatch, xml_archive_tag_name_error } exception_code; - xml_archive_exception(exception_code c) + xml_archive_exception(exception_code /* c */) {} virtual const char *what( ) const throw( ) { Modified: dcplusplus/trunk/boost/boost/archive/detail/iserializer.hpp =================================================================== --- dcplusplus/trunk/boost/boost/archive/detail/iserializer.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/archive/detail/iserializer.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -121,7 +121,7 @@ return boost::serialization::implementation_level<T>::value >= boost::serialization::object_class_info; } - virtual bool tracking(const unsigned int flags) const { + virtual bool tracking(const unsigned int /* flags */) const { // if(0 != (flags & no_tracking)) // return false; return boost::serialization::tracking_level<T>::value Modified: dcplusplus/trunk/boost/boost/archive/detail/oserializer.hpp =================================================================== --- dcplusplus/trunk/boost/boost/archive/detail/oserializer.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/archive/detail/oserializer.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -114,7 +114,7 @@ return boost::serialization::implementation_level<T>::value >= boost::serialization::object_class_info; } - virtual bool tracking(const unsigned int flags) const { + virtual bool tracking(const unsigned int /* flags */) const { // if(0 != (flags & no_tracking)) // return false; return boost::serialization::tracking_level<T>::value == boost::serialization::track_always Modified: dcplusplus/trunk/boost/boost/date_time/date_generators.hpp =================================================================== --- dcplusplus/trunk/boost/boost/date_time/date_generators.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/date_time/date_generators.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) * Author: Jeff Garland, Bart Garst - * $Date: 2005/04/17 21:48:19 $ + * $Date: 2007/06/01 16:12:07 $ */ /*! @file date_generators.hpp @@ -153,6 +153,8 @@ month_type month_; }; + //! Returns nth arg as string. 1 -> "first", 2 -> "second", max is 5. + BOOST_DATE_TIME_DECL const char* nth_as_str(int n); //! Useful generator functor for finding holidays /*! Based on the idea in Cal. Calc. for finding holidays that are @@ -241,10 +243,8 @@ week_num wn_; day_of_week_type dow_; }; - - //! Returns nth arg as string. 1 -> "first", 2 -> "second", max is 5. - BOOST_DATE_TIME_DECL const char* nth_as_str(int n); + //! Useful generator functor for finding holidays and daylight savings /*! Similar to nth_kday_of_month, but requires less paramters * \ingroup date_alg Modified: dcplusplus/trunk/boost/boost/date_time/time_resolution_traits.hpp =================================================================== --- dcplusplus/trunk/boost/boost/date_time/time_resolution_traits.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/date_time/time_resolution_traits.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) * Author: Jeff Garland, Bart Garst - * $Date: 2005/08/25 16:27:20 $ + * $Date: 2007/05/25 19:58:16 $ */ @@ -120,11 +120,10 @@ + (fractional_seconds_type(minutes)*60) + seconds)*res_adjust()) + fs) * -1); } - else{ - return (((fractional_seconds_type(hours)*3600) - + (fractional_seconds_type(minutes)*60) - + seconds)*res_adjust()) + fs; - } + + return (((fractional_seconds_type(hours)*3600) + + (fractional_seconds_type(minutes)*60) + + seconds)*res_adjust()) + fs; } }; Modified: dcplusplus/trunk/boost/boost/detail/atomic_count_gcc.hpp =================================================================== --- dcplusplus/trunk/boost/boost/detail/atomic_count_gcc.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/detail/atomic_count_gcc.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -17,7 +17,11 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include <bits/atomicity.h> +#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) +# include <ext/atomicity.h> +#else +# include <bits/atomicity.h> +#endif namespace boost { Modified: dcplusplus/trunk/boost/boost/function.hpp =================================================================== --- dcplusplus/trunk/boost/boost/function.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/function.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -21,8 +21,8 @@ // in anything that may be included by function_template.hpp doesn't break #include <boost/function/detail/prologue.hpp> -// Visual Age C++ doesn't handle the file iteration well -#if BOOST_WORKAROUND(__IBMCPP__, >= 500) +// Older versions of the IBM C++ compiler do not handle file iterations well +#if BOOST_WORKAROUND(__IBMCPP__, >= 500) && BOOST_WORKAROUND(__IBMCPP__, < 800) # if BOOST_FUNCTION_MAX_ARGS >= 0 # include <boost/function/function0.hpp> # endif Modified: dcplusplus/trunk/boost/boost/functional/hash/hash.hpp =================================================================== --- dcplusplus/trunk/boost/boost/functional/hash/hash.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/functional/hash/hash.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -1,5 +1,5 @@ -// Copyright Daniel James 2005-2006. Use, modification, and distribution are +// Copyright Daniel James 2005-2007. Use, modification, and distribution are // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -28,6 +28,11 @@ #include <boost/type_traits/is_const.hpp> #endif +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4267) +#endif + namespace boost { #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) @@ -41,12 +46,13 @@ std::size_t hash_value(long); std::size_t hash_value(unsigned long); -#if defined(BOOST_MSVC) && defined(_WIN64) +#if defined(BOOST_HAS_LONG_LONG) && defined(_M_X64) && defined(_WIN64) // On 64-bit windows std::size_t is a typedef for unsigned long long, which // isn't due to be supported until Boost 1.35. So add support here. // (Technically, Boost.Hash isn't actually documented as supporting // std::size_t. But it would be pretty silly not to). - std::size_t hash_value(std::size_t); + std::size_t hash_value(long long); + std::size_t hash_value(unsigned long long); #endif #if !BOOST_WORKAROUND(__DMC__, <= 0x848) @@ -116,7 +122,7 @@ return static_cast<std::size_t>(v); } -#if defined(_M_X64) && defined(_WIN64) +#if defined(BOOST_HAS_LONG_LONG) && defined(_M_X64) && defined(_WIN64) inline std::size_t hash_value(long long v) { return v; @@ -588,5 +594,9 @@ #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION } +#if defined(BOOST_MSVC) +# pragma warning(pop) #endif +#endif + Modified: dcplusplus/trunk/boost/boost/graph/relax.hpp =================================================================== --- dcplusplus/trunk/boost/boost/graph/relax.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/graph/relax.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -22,16 +22,13 @@ template <class T> struct closed_plus { - // std::abs just isn't portable :( - template <class X> - inline X my_abs(const X& x) const { return x < 0 ? -x : x; } - T operator()(const T& a, const T& b) const { using namespace std; - T inf = (numeric_limits<T>::max)(); - if (b > 0 && my_abs(inf - a) < b) - return inf; - return a + b; + T zero(0); + T result = a + b; + if (result < zero && a >= zero && b >= zero) + return (numeric_limits<T>::max)(); + return result; } }; Modified: dcplusplus/trunk/boost/boost/iostreams/char_traits.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/char_traits.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/char_traits.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -27,8 +27,8 @@ namespace boost { namespace iostreams { -// Dinkumware that comes with QNX Momentics 6.3.0, 4.0.2, incorrectly defines the -// EOF and WEOF macros to not std:: qualify the wint_t type (and so does +// Dinkumware that comes with QNX Momentics 6.3.0, 4.0.2, incorrectly defines +// the EOF and WEOF macros to not std:: qualify the wint_t type (and so does // Sun C++ 5.8 + STLport 4). Fix by placing the def in this scope. // NOTE: Use BOOST_WORKAROUND? #if (defined(__QNX__) && defined(BOOST_DINKUMWARE_STDLIB)) \ Modified: dcplusplus/trunk/boost/boost/iostreams/checked_operations.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/checked_operations.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/checked_operations.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -127,7 +127,7 @@ template<> struct seek_if_impl<random_access> { template<typename T> - static stream_offset + static std::streampos seek( T& t, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which ) { return iostreams::seek(t, off, way, which); } @@ -136,7 +136,7 @@ template<> struct seek_if_impl<any_tag> { template<typename T> - static stream_offset + static std::streampos seek(T&, stream_offset, BOOST_IOS::seekdir, BOOST_IOS::openmode) { throw cant_seek(); } }; Modified: dcplusplus/trunk/boost/boost/iostreams/code_converter.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/code_converter.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/code_converter.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -23,7 +23,7 @@ #include <algorithm> // max. #include <cstring> // memcpy. #include <exception> -#include <boost/config.hpp> // DEDUCED_TYPENAME. +#include <boost/config.hpp> // DEDUCED_TYPENAME, #include <boost/iostreams/char_traits.hpp> #include <boost/iostreams/constants.hpp> // default_filter_buffer_size. #include <boost/iostreams/detail/adapter/concept_adapter.hpp> @@ -57,6 +57,32 @@ namespace detail { +//--------------Definition of strncpy_if_same---------------------------------// + +// Helper template for strncpy_if_same, below. +template<bool B> +struct strncpy_if_same_impl; + +template<> +struct strncpy_if_same_impl<true> { + template<typename Ch> + static Ch* copy(Ch* tgt, const Ch* src, std::streamsize n) + { return BOOST_IOSTREAMS_CHAR_TRAITS(Ch)::copy(tgt, src, n); } +}; + +template<> +struct strncpy_if_same_impl<false> { + template<typename Src, typename Tgt> + static Tgt* copy(Tgt* tgt, const Src*, std::streamsize) { return tgt; } +}; + +template<typename Src, typename Tgt> +Tgt* strncpy_if_same(Tgt* tgt, const Src* src, std::streamsize n) +{ + typedef strncpy_if_same_impl<is_same<Src, Tgt>::value> impl; + return impl::copy(tgt, src, n); +} + //--------------Definition of conversion_buffer-------------------------------// // Buffer and conversion state for reading. @@ -169,7 +195,7 @@ policy_type& dev() { return **dev_; } - enum { + enum flag_type { f_open = 1, f_input_closed = f_open << 1, f_output_closed = f_input_closed << 1 @@ -311,16 +337,18 @@ break; case codecvt_base::ok: break; + case codecvt_base::noconv: + { + streamsize amt = + std::min<streamsize>(next - buf.ptr(), n - total); + detail::strncpy_if_same(s + total, buf.ptr(), amt); + total += amt; + } + break; case codecvt_base::error: + default: buf.state() = state_type(); throw code_conversion_error(); - case codecvt_base::noconv: - default: - buf.state() = state_type(); - intern_type c = intern_type(); - memcpy(&c, (const void*) buf.ptr(), sizeof(extern_type)); - s[total++] = c; - break; } } while (total < n && status != EOF && status != WOULD_BLOCK); @@ -362,24 +390,19 @@ case codecvt_base::ok: total = static_cast<streamsize>(nint - s); break; + case codecvt_base::noconv: + { + streamsize amt = + std::min<streamsize>( nint - total - s, + buf.end() - buf.eptr() ); + detail::strncpy_if_same(buf.eptr(), s + total, amt); + total += amt; + } + break; case codecvt_base::error: + default: buf.state() = state_type(); throw code_conversion_error(); - case codecvt_base::noconv: - { - // This can be shortened to two memcpy's. - const char* c = (const char*) (s + total); - for ( std::size_t index = 0; - index < sizeof(intern_type); - index += sizeof(extern_type), - ++buf.ptr() ) - { - memcpy(buf.ptr(), c + index, sizeof(extern_type)); - if (buf.eptr() == buf.end()) - buf.flush(dev()); - } - ++total; - } } } return total; Modified: dcplusplus/trunk/boost/boost/iostreams/compose.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/compose.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/compose.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -78,9 +78,9 @@ composite_device(const Filter& flt, param_type dev); std::streamsize read(char_type* s, std::streamsize n); std::streamsize write(const char_type* s, std::streamsize n); - stream_offset seek( stream_offset off, BOOST_IOS::seekdir way, - BOOST_IOS::openmode which = - BOOST_IOS::in | BOOST_IOS::out ); + std::streampos seek( stream_offset off, BOOST_IOS::seekdir way, + BOOST_IOS::openmode which = + BOOST_IOS::in | BOOST_IOS::out ); void close(); void close(BOOST_IOS::openmode which); @@ -142,9 +142,9 @@ } template<typename Device> - stream_offset seek( Device& dev, stream_offset off, BOOST_IOS::seekdir way, - BOOST_IOS::openmode which = - BOOST_IOS::in | BOOST_IOS::out ) + std::streampos seek( Device& dev, stream_offset off, BOOST_IOS::seekdir way, + BOOST_IOS::openmode which = + BOOST_IOS::in | BOOST_IOS::out ) { composite_device<filter_ref, Device> cmp(boost::ref(filter2_), dev); return iostreams::seek(filter1_, cmp, off, way, which); @@ -325,7 +325,7 @@ { return iostreams::write(filter_, device_, s, n); } template<typename Filter, typename Device, typename Mode> -stream_offset composite_device<Filter, Device, Mode>::seek +std::streampos composite_device<Filter, Device, Mode>::seek (stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which) { return iostreams::seek(filter_, device_, off, way, which); } Modified: dcplusplus/trunk/boost/boost/iostreams/detail/adapter/concept_adapter.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/detail/adapter/concept_adapter.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/detail/adapter/concept_adapter.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -80,16 +80,16 @@ std::streamsize write(const char_type* s, std::streamsize n, Sink* snk) { return output_impl::write(t_, snk, s, n); } - stream_offset seek( stream_offset off, BOOST_IOS::seekdir way, - BOOST_IOS::openmode which ) + std::streampos seek( stream_offset off, BOOST_IOS::seekdir way, + BOOST_IOS::openmode which ) { return this->seek( off, way, which, (basic_null_device<char_type, seekable>*) 0); } template<typename Device> - stream_offset seek( stream_offset off, BOOST_IOS::seekdir way, - BOOST_IOS::openmode which, Device* dev ) + std::streampos seek( stream_offset off, BOOST_IOS::seekdir way, + BOOST_IOS::openmode which, Device* dev ) { return any_impl::seek(t_, dev, off, way, which); } void close(BOOST_IOS::openmode which) @@ -122,7 +122,7 @@ template<> struct device_wrapper_impl<any_tag> { template<typename Device, typename Dummy> - static stream_offset + static std::streampos seek( Device& dev, Dummy*, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which ) { @@ -131,7 +131,7 @@ } template<typename Device> - static stream_offset + static std::streampos seek( Device&, stream_offset, BOOST_IOS::seekdir, BOOST_IOS::openmode, any_tag ) { @@ -139,7 +139,7 @@ } template<typename Device> - static stream_offset + static std::streampos seek( Device& dev, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which, random_access ) @@ -191,7 +191,7 @@ template<> struct flt_wrapper_impl<any_tag> { template<typename Filter, typename Device> - static stream_offset + static std::streampos seek( Filter& f, Device* dev, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which ) { @@ -200,13 +200,13 @@ } template<typename Filter, typename Device> - static stream_offset + static std::streampos seek( Filter&, Device*, stream_offset, BOOST_IOS::seekdir, BOOST_IOS::openmode, any_tag ) { throw cant_seek(); } template<typename Filter, typename Device> - static stream_offset + static std::streampos seek( Filter& f, Device* dev, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which, random_access tag ) @@ -216,14 +216,14 @@ } template<typename Filter, typename Device> - static stream_offset + static std::streampos seek( Filter& f, Device* dev, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which, random_access, any_tag ) { return f.seek(*dev, off, way); } template<typename Filter, typename Device> - static stream_offset + static std::streampos seek( Filter& f, Device* dev, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which, random_access, two_sequence ) Modified: dcplusplus/trunk/boost/boost/iostreams/detail/adapter/direct_adapter.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/detail/adapter/direct_adapter.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/detail/adapter/direct_adapter.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -111,8 +111,8 @@ std::streamsize read(char_type* s, std::streamsize n); std::streamsize write(const char_type* s, std::streamsize n); - stream_offset seek( stream_offset, BOOST_IOS::seekdir, - BOOST_IOS::openmode = BOOST_IOS::in | BOOST_IOS::out ); + std::streampos seek( stream_offset, BOOST_IOS::seekdir, + BOOST_IOS::openmode = BOOST_IOS::in | BOOST_IOS::out ); void close(); void close(BOOST_IOS::openmode which); #ifndef BOOST_IOSTREAMS_NO_LOCALE @@ -214,7 +214,7 @@ } template<typename Direct> -inline stream_offset direct_adapter<Direct>::seek +inline std::streampos direct_adapter<Direct>::seek ( stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which ) { @@ -248,7 +248,7 @@ else bad_seek(); } - return static_cast<stream_offset>(next); + return offset_to_position(next); } template<typename Direct> Modified: dcplusplus/trunk/boost/boost/iostreams/detail/adapter/mode_adapter.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/detail/adapter/mode_adapter.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/detail/adapter/mode_adapter.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -48,9 +48,9 @@ std::streamsize read(char_type* s, std::streamsize n); std::streamsize write(const char_type* s, std::streamsize n); - stream_offset seek( stream_offset off, BOOST_IOS::seekdir way, - BOOST_IOS::openmode which = - BOOST_IOS::in | BOOST_IOS::out ); + std::streampos seek( stream_offset off, BOOST_IOS::seekdir way, + BOOST_IOS::openmode which = + BOOST_IOS::in | BOOST_IOS::out ); #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) void close(BOOST_IOS::openmode which = BOOST_IOS::in | BOOST_IOS::out); #endif @@ -66,12 +66,12 @@ { return iostreams::write(t_, snk, s, n); } template<typename Device> - stream_offset seek(Device& dev, stream_offset off, BOOST_IOS::seekdir way) + std::streampos seek(Device& dev, stream_offset off, BOOST_IOS::seekdir way) { return iostreams::seek(t_, dev, off, way); } template<typename Device> - stream_offset seek( Device& dev, stream_offset off, - BOOST_IOS::seekdir way, BOOST_IOS::openmode which ) + std::streampos seek( Device& dev, stream_offset off, + BOOST_IOS::seekdir way, BOOST_IOS::openmode which ) { return iostreams::seek(t_, dev, off, way, which); } template<typename Device> @@ -102,7 +102,7 @@ { return boost::iostreams::write(t_, s, n); } template<typename Mode, typename T> -stream_offset mode_adapter<Mode, T>::seek +std::streampos mode_adapter<Mode, T>::seek (stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which) { return boost::iostreams::seek(t_, off, way, which); } Modified: dcplusplus/trunk/boost/boost/iostreams/detail/adapter/non_blocking_adapter.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/detail/adapter/non_blocking_adapter.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/detail/adapter/non_blocking_adapter.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -44,9 +44,9 @@ } return result; } - stream_offset seek( stream_offset off, BOOST_IOS::seekdir way, - BOOST_IOS::openmode which = - BOOST_IOS::in | BOOST_IOS::out ) + std::streampos seek( stream_offset off, BOOST_IOS::seekdir way, + BOOST_IOS::openmode which = + BOOST_IOS::in | BOOST_IOS::out ) { return iostreams::seek(device_, off, way, which); } public: Device& device_; Modified: dcplusplus/trunk/boost/boost/iostreams/detail/adapter/range_adapter.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/detail/adapter/range_adapter.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/detail/adapter/range_adapter.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -62,7 +62,7 @@ range_adapter(iterator first, iterator last); std::streamsize read(char_type* s, std::streamsize n); std::streamsize write(const char_type* s, std::streamsize n); - stream_offset seek(stream_offset off, BOOST_IOS::seekdir way); + std::streampos seek(stream_offset off, BOOST_IOS::seekdir way); private: iterator first_, cur_, last_; }; @@ -89,11 +89,11 @@ template<typename Mode, typename Range> -stream_offset range_adapter<Mode, Range>::seek +std::streampos range_adapter<Mode, Range>::seek (stream_offset off, BOOST_IOS::seekdir way) { impl::seek(first_, cur_, last_, off, way); - return static_cast<stream_offset>(cur_ - first_); + return offset_to_position(cur_ - first_); } //------------------Implementation of range_adapter_impl----------------------// Modified: dcplusplus/trunk/boost/boost/iostreams/detail/resolve.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/detail/resolve.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/detail/resolve.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -47,10 +47,7 @@ struct resolve_traits { typedef typename mpl::if_< - mpl::and_< - boost::detail::is_incrementable<T>, // Must come first - is_dereferenceable<T> // for CW 9.[0-4] - >, + boost::detail::is_incrementable<T>, output_iterator_adapter<Mode, Ch, T>, const T& >::type type; @@ -163,10 +160,7 @@ mode_adapter<Mode, T>, is_iterator_range<T>, range_adapter<Mode, T>, - mpl::and_< - is_dereferenceable<T>, - boost::detail::is_incrementable<T> - >, + is_dereferenceable<T>, output_iterator_adapter<Mode, Ch, T>, is_array<T>, array_adapter<Mode, T>, Modified: dcplusplus/trunk/boost/boost/iostreams/detail/streambuf/direct_streambuf.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/detail/streambuf/direct_streambuf.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/detail/streambuf/direct_streambuf.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -24,6 +24,7 @@ #include <boost/iostreams/detail/streambuf/linked_streambuf.hpp> #include <boost/iostreams/detail/error.hpp> #include <boost/iostreams/operations.hpp> +#include <boost/iostreams/positioning.hpp> #include <boost/iostreams/traits.hpp> // Must come last. @@ -52,7 +53,7 @@ ) streambuf_type; public: // stream needs access. void open(const T& t, int buffer_size, int pback_size); - bool is_open(); + bool is_open() const; void close(); bool auto_close() const { return auto_close_; } void set_auto_close(bool close) { auto_close_ = close; } @@ -85,7 +86,7 @@ BOOST_IOS::openmode which ); pos_type seekpos(pos_type sp, BOOST_IOS::openmode which); private: - pos_type seek_impl( off_type off, BOOST_IOS::seekdir way, + pos_type seek_impl( stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which ); void init_input(any_tag) { } void init_input(input); @@ -118,7 +119,8 @@ } template<typename T, typename Tr> -bool direct_streambuf<T, Tr>::is_open() { return ibeg_ != 0 && !obeg_ != 0; } +bool direct_streambuf<T, Tr>::is_open() const +{ return ibeg_ != 0 && !obeg_ != 0; } template<typename T, typename Tr> void direct_streambuf<T, Tr>::close() @@ -185,7 +187,10 @@ inline typename direct_streambuf<T, Tr>::pos_type direct_streambuf<T, Tr>::seekpos (pos_type sp, BOOST_IOS::openmode) -{ return seek_impl(sp, BOOST_IOS::beg, BOOST_IOS::in | BOOST_IOS::out); } +{ + return seek_impl( position_to_offset(sp), BOOST_IOS::beg, + BOOST_IOS::in | BOOST_IOS::out ); +} template<typename T, typename Tr> void direct_streambuf<T, Tr>::close(BOOST_IOS::openmode which) @@ -204,13 +209,13 @@ template<typename T, typename Tr> typename direct_streambuf<T, Tr>::pos_type direct_streambuf<T, Tr>::seek_impl - (off_type off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which) + (stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which) { using namespace std; BOOST_IOS::openmode both = BOOST_IOS::in | BOOST_IOS::out; if (two_head() && (which & both) == both) throw bad_seek(); - off_type result = -1; + stream_offset result = -1; bool one = one_head(); if (one && (pptr() != 0 || gptr()== 0)) init_get_area(); // Switch to input mode, for code reuse. @@ -242,7 +247,7 @@ pbump(static_cast<int>(next - (pptr() - obeg_))); result = next; } - return result; + return offset_to_position(result); } template<typename T, typename Tr> Modified: dcplusplus/trunk/boost/boost/iostreams/detail/streambuf/indirect_streambuf.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/detail/streambuf/indirect_streambuf.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/detail/streambuf/indirect_streambuf.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -118,7 +118,7 @@ void sync_impl(); void close_impl(BOOST_IOS::openmode); - enum { + enum flag_type { f_open = 1, f_input_closed = f_open << 1, f_output_closed = f_input_closed << 1, @@ -328,7 +328,10 @@ inline typename indirect_streambuf<T, Tr, Alloc, Mode>::pos_type indirect_streambuf<T, Tr, Alloc, Mode>::seekpos (pos_type sp, BOOST_IOS::openmode) -{ return seek_impl(sp, BOOST_IOS::beg, BOOST_IOS::in | BOOST_IOS::out); } +{ + return seek_impl( position_to_offset(sp), BOOST_IOS::beg, + BOOST_IOS::in | BOOST_IOS::out ); +} template<typename T, typename Tr, typename Alloc, typename Mode> typename indirect_streambuf<T, Tr, Alloc, Mode>::pos_type Modified: dcplusplus/trunk/boost/boost/iostreams/device/file.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/device/file.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/device/file.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -51,9 +51,9 @@ BOOST_IOS::in | BOOST_IOS::out ); std::streamsize read(char_type* s, std::streamsize n); std::streamsize write(const char_type* s, std::streamsize n); - stream_offset seek( stream_offset off, BOOST_IOS::seekdir way, - BOOST_IOS::openmode which = - BOOST_IOS::in | BOOST_IOS::out ); + std::streampos seek( stream_offset off, BOOST_IOS::seekdir way, + BOOST_IOS::openmode which = + BOOST_IOS::in | BOOST_IOS::out ); void open( const std::string& path, BOOST_IOS::openmode mode = BOOST_IOS::in | BOOST_IOS::out, @@ -154,7 +154,7 @@ { return pimpl_->file_.sputn(s, n); } template<typename Ch> -stream_offset basic_file<Ch>::seek +std::streampos basic_file<Ch>::seek ( stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode ) { return iostreams::seek(pimpl_->file_, off, way); } Modified: dcplusplus/trunk/boost/boost/iostreams/device/file_descriptor.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/device/file_descriptor.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/device/file_descriptor.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -63,7 +63,7 @@ bool is_open() const { return pimpl_->flags_ != 0; } std::streamsize read(char_type* s, std::streamsize n); std::streamsize write(const char_type* s, std::streamsize n); - stream_offset seek(stream_offset off, BOOST_IOS::seekdir way); + std::streampos seek(stream_offset off, BOOST_IOS::seekdir way); void close(); private: struct impl { Modified: dcplusplus/trunk/boost/boost/iostreams/device/mapped_file.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/device/mapped_file.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/device/mapped_file.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -137,7 +137,7 @@ //------------------Definition of mapped_file---------------------------------// -class mapped_file { +class BOOST_IOSTREAMS_DECL mapped_file { private: typedef mapped_file_source delegate_type; delegate_type delegate_; @@ -202,7 +202,7 @@ static int alignment() { return mapped_file_source::alignment(); } }; -struct mapped_file_sink : private mapped_file { +struct BOOST_IOSTREAMS_DECL mapped_file_sink : private mapped_file { friend struct operations<mapped_file_sink>; typedef char char_type; struct category Modified: dcplusplus/trunk/boost/boost/iostreams/device/null.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/device/null.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/device/null.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -30,9 +30,9 @@ { }; std::streamsize read(Ch*, std::streamsize) { return 0; } std::streamsize write(const Ch*, std::streamsize n) { return n; } - stream_offset seek( stream_offset, BOOST_IOS::seekdir, - BOOST_IOS::openmode = - BOOST_IOS::in | BOOST_IOS::out ) + std::streampos seek( stream_offset, BOOST_IOS::seekdir, + BOOST_IOS::openmode = + BOOST_IOS::in | BOOST_IOS::out ) { return -1; } void close(BOOST_IOS::openmode = BOOST_IOS::in | BOOST_IOS::out) { } }; Modified: dcplusplus/trunk/boost/boost/iostreams/filter/aggregate.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/filter/aggregate.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/filter/aggregate.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -145,7 +145,7 @@ do_close(); } - enum { + enum flag_type { f_read = 1, f_write = f_read << 1, f_eof = f_write << 1 Modified: dcplusplus/trunk/boost/boost/iostreams/filter/gzip.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/filter/gzip.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/filter/gzip.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -234,14 +234,20 @@ template<typename Sink> void close(Sink& snk, BOOST_IOS::openmode m) { + namespace io = boost::iostreams; + if (m & BOOST_IOS::out) { // Close zlib compressor. base_type::close(snk, BOOST_IOS::out); - // Write final fields of gzip file format. - write_long(this->crc(), snk); - write_long(this->total_in(), snk); + if (flags_ & f_header_done) { + + // Write final fields of gzip file format. + write_long(this->crc(), snk); + write_long(this->total_in(), snk); + } + } #if BOOST_WORKAROUND(__GNUC__, == 2) && defined(__STL_CONFIG_H) || \ BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) \ @@ -267,7 +273,7 @@ boost::iostreams::put(next, static_cast<char>(0xFF & (n >> 24))); } - enum { + enum flag_type { f_header_done = 1, f_body_done = f_header_done << 1, f_footer_done = f_body_done << 1 @@ -456,7 +462,7 @@ if (static_cast<int>(read_uint32(rng, gzip::bad_footer)) != this->total_out()) throw gzip_error(gzip::bad_length); } - enum { + enum flag_type { f_header_read = 1, f_footer_read = f_header_read << 1, f_text = f_footer_read << 1 @@ -547,11 +553,11 @@ static_cast<streamsize>(str.size() - offset_); streamsize amt = (std::min)(avail, n); std::copy( str.data() + offset_, - str.data() + offset_ + amt, - s ); + str.data() + offset_ + amt, + s ); offset_ += amt; if ( !(flags_ & f_header_done) && - offset_ == static_cast<std::size_t>(str.size()) ) + offset_ == static_cast<std::size_t>(str.size()) ) { flags_ |= f_header_done; } Modified: dcplusplus/trunk/boost/boost/iostreams/filter/line.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/filter/line.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/filter/line.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -193,7 +193,7 @@ pos_ = string_type::npos; } - enum { + enum flag_type { f_read = 1, f_write = f_read << 1 }; Modified: dcplusplus/trunk/boost/boost/iostreams/filter/zlib.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/filter/zlib.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/filter/zlib.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -332,7 +332,7 @@ template<typename Alloc> zlib_compressor_impl<Alloc>::~zlib_compressor_impl() -{ /*reset(true, false);*/ } +{ reset(true, false); } template<typename Alloc> bool zlib_compressor_impl<Alloc>::filter @@ -357,7 +357,7 @@ template<typename Alloc> zlib_decompressor_impl<Alloc>::~zlib_decompressor_impl() -{ /*reset(false, false);*/ } +{ reset(false, false); } template<typename Alloc> zlib_decompressor_impl<Alloc>::zlib_decompressor_impl(int window_bits) Modified: dcplusplus/trunk/boost/boost/iostreams/restrict.hpp =================================================================== --- dcplusplus/trunk/boost/boost/iostreams/restrict.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/iostreams/restrict.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -61,7 +61,7 @@ stream_offset len = -1 ); std::streamsize read(char_type* s, std::streamsize n); std::streamsize write(const char_type* s, std::streamsize n); - stream_offset seek(stream_offset off, BOOST_IOS::seekdir way); + std::streampos seek(stream_offset off, BOOST_IOS::seekdir way); private: stream_offset beg_, pos_, end_; }; @@ -145,7 +145,7 @@ } template<typename Device> - stream_offset seek(Device& dev, stream_offset off, BOOST_IOS::seekdir way) + std::streampos seek(Device& dev, stream_offset off, BOOST_IOS::seekdir way) { stream_offset next; if (way == BOOST_IOS::beg) { @@ -159,12 +159,12 @@ pos_ = this->component().seek(dev, off, BOOST_IOS::end); if (pos_ < beg_) bad_seek(); - return pos_ - beg_; + return offset_to_position(pos_ - beg_); } if (next < beg_ || end_ != -1 && next >= end_) bad_seek(); pos_ = this->component().seek(dev, next, BOOST_IOS::cur); - return pos_ - beg_; + return offset_to_position(pos_ - beg_); } private: template<typename Device> @@ -329,7 +329,7 @@ } template<typename Device> -stream_offset restricted_indirect_device<Device>::seek +std::streampos restricted_indirect_device<Device>::seek (stream_offset off, BOOST_IOS::seekdir way) { stream_offset next; @@ -344,12 +344,12 @@ pos_ = iostreams::seek(this->component(), off, BOOST_IOS::end); if (pos_ < beg_) bad_seek(); - return pos_ - beg_; + return offset_to_position(pos_ - beg_); } if (next < beg_ || end_ != -1 && next >= end_) bad_seek(); pos_ = iostreams::seek(this->component(), next - pos_, BOOST_IOS::cur); - return pos_ - beg_; + return offset_to_position(pos_ - beg_); } //--------------Implementation of restricted_direct_device--------------------// Modified: dcplusplus/trunk/boost/boost/limits.hpp =================================================================== --- dcplusplus/trunk/boost/boost/limits.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/limits.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -76,8 +76,8 @@ static BOOST_LLT denorm_min() throw() { return 0; }; BOOST_STATIC_CONSTANT(bool, is_iec559 = false); - BOOST_STATIC_CONSTANT(bool, is_bounded = false); - BOOST_STATIC_CONSTANT(bool, is_modulo = false); + BOOST_STATIC_CONSTANT(bool, is_bounded = true); + BOOST_STATIC_CONSTANT(bool, is_modulo = true); BOOST_STATIC_CONSTANT(bool, traps = false); BOOST_STATIC_CONSTANT(bool, tinyness_before = false); @@ -129,8 +129,8 @@ static BOOST_ULLT denorm_min() throw() { return 0; }; BOOST_STATIC_CONSTANT(bool, is_iec559 = false); - BOOST_STATIC_CONSTANT(bool, is_bounded = false); - BOOST_STATIC_CONSTANT(bool, is_modulo = false); + BOOST_STATIC_CONSTANT(bool, is_bounded = true); + BOOST_STATIC_CONSTANT(bool, is_modulo = true); BOOST_STATIC_CONSTANT(bool, traps = false); BOOST_STATIC_CONSTANT(bool, tinyness_before = false); @@ -141,3 +141,4 @@ #endif #endif + Modified: dcplusplus/trunk/boost/boost/numeric/interval/detail/ppc_rounding_control.hpp =================================================================== --- dcplusplus/trunk/boost/boost/numeric/interval/detail/ppc_rounding_control.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/numeric/interval/detail/ppc_rounding_control.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -51,10 +51,14 @@ } // namespace detail +// Do not declare the following C99 symbols if <math.h> provides them. +// Otherwise, conflicts may occur, due to differences between prototypes. +#if !defined(_ISOC99_SOURCE) && !defined(__USE_ISOC99) extern "C" { float rintf(float); double rint(double); } +#endif template<> struct rounding_control<float>: Modified: dcplusplus/trunk/boost/boost/operators.hpp =================================================================== --- dcplusplus/trunk/boost/boost/operators.hpp 2007-12-20 10:02:19 UTC (rev 947) +++ dcplusplus/trunk/boost/boost/operators.hpp 2007-12-22 22:38:16 UTC (rev 948) @@ -8,6 +8,8 @@ // See http://www.boost.org/libs/utility/operators.htm for documentation. // Revision History +// 24 May 07 Changed empty_base to depend on T, see +// http://svn.boost.org/trac/boost/ticket/979 // 21 Oct 02 Modified implementation of operators to allow compilers with a // correct named return value optimization (NRVO) to produce optimal // code. (Daniel Frey) @@ -90,15 +92,15 @@ namespace boost { namespace detail { +template <typename T> class empty_base { + // Helmut Zeisel, empty base class optimization bug with GCC 3.0.0 #if defined(__GNUC__) && __GNUC__==3 && __GNUC_MINOR__==0 && __GNU_PATCHLEVEL__==0 -class empty_base { bool dummy; -}; -#else -class empty_base {}; #endif +}; + } // namespace detail } // namespace boost @@ -119,7 +121,7 @@ // Note that friend functions defined in a class are implicitly inline. // See the C++ std, 11.4 [class.friend] paragraph 5 -template <class T, class U, class B = ::boost::detail::empty_base> +template <class T, class U, class B = ::boost::detail::empty_base<T> > struct less_than_comparable2 : B { friend bool operator<=(const T& x, const U& y) { return !(x > y); } @@ -130,7 +132,7 @@ friend bool operator>=(const U& x, const T& y) { return !(y > x); } }; -template <class T, class B = ::boost::detail::empty_base> +template <class T, class B = ::boost::detail::empty_base<T> > struct less_than_comparable1 : B { friend bool operator>(const T& x, const T& y) { return y < x; } @@ -138,7 +140,7 @@ friend bool operator>=(const T& x, const T& y) { return !(x < y); } }; -template <class T, class U, class B = ::boost::detail::empty_base> +template <class T, class U, class B = ::boost::detail::empty_base<T> > struct equality_comparable2 : B { friend bool operator==(const U& y, const T& x) { return x == y; } @@ -146,7 +148,7 @@ friend bool operator!=(const T& y, const U& x) { return !(y == x); } }; -template <class T, class B = ::boost::detail::empty_base> +template <class T, class B = ::boost::detail::empty_base<T> > struct equality_comparable1 : B { friend bool operator!=(const T& x, const T& y) { return !(x == y); } @@ -165,7 +167,7 @@ // implementation available. #define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \ -template <class T, class U, class B = ::boost::detail::empty_base> \ +template <class T, class U, class B = ::boost::detail::empty_base<T> > \ struct NAME##2 : B \ { \ friend T operator OP( const T& lhs, const U& rhs ) \ @@ -174,33 +176,33 @@ { T nrv( rhs ); nrv OP##= lhs; return nrv; } \ }; \ \ -template <class T, class B = ::boost::detail::empty_base> \ +template <class T, class B = ::boost::detail::empty_base<T> > \ struct NAME##1 : B \ { \ friend T operator OP( const T& lhs, const T& rhs ) \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; -#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \ -template <class T, class U, class B = ::boost::detail::empty_base> \ -struct NAME##2 : B \ -{ \ - friend T operator OP( const T& lhs, const U& rhs ) \ - { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ -}; \ - \ -template <class T, class U, class B = ::boost::detail::empty_base> \ -struct BOOST_OPERATOR2_LEFT(NAME) : B \ -{ \ - friend T operator OP( const U& lhs, const T& rhs ) \ - { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ -}; \ - \ -template <class T, class B = ::boost::detail::empty_base> \ -struct NAME##1 : B \ -{ \ - friend T operator OP( const T& lhs, const T& rhs ) \ - { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ +#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \ +template <class T, class U, class B = ::boost::detail::empty_base<T> > \ +struct NAME##2 : B \ +{ \ + friend T operator OP( const T& lhs, const U& rhs ) \ + { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ +}; \ + \ +template <class T, class U, class B = ::boost::detail::empty_base<T> > \ +struct BOOST_OPERATOR2_LEFT(NAME) : B \ +{ \ + friend T operator OP( const U& lhs, const T& rhs ) \ + { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ +}; \ + \ +template <class T, class B = ::boost::detail::empty_base<T> > \ +struct NAME##1 : B \ +{ \ + friend T operator OP( const T& lhs, const T& rhs ) \ + { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; #else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) @@ -210,35 +212,35 @@ // BOOST_OPERATOR2_LEFT(NAME) only looks cool, but doesn't provide // optimization opportunities to the compiler :) -#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \ -template <class T, class U, class B = ::boost::detail::empty_base> \ -struct NAME##2 : B \ -{ \ - friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ - friend T operator OP( const U& lhs, T rhs ) { return rhs OP##= lhs; } \ -}; \ - \ -template <class T, class B = ::boost::detail::empty_base> \ -struct NAME##1 : B \ -{ \ - friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ +#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \ +template <class T, class U, class B = ::boost::detail::empty_base<T> > \ +struct NAME##2 : B \ +{ \ + friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ + friend T operator OP( const U& lhs, T rhs ) { return rhs OP##= lhs; } \ +}; \ + \ +template <class T, class B = ::boost::detail::empty_base<T> > \ +struct NAME##1 : B \ +{ \ + friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ }; #define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \ -template <class T, class U, class B = ::boost::detail::empty_base> \ +template <class T, class U, class B = ::boost::detail::empty_base<T> > \ struct NAME##2 : B \ { \ friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ }; \ \ -template <class T, class U, class B = ::boost::detail::empty_base> \ +template <class T, class U, class B = ::boost::detail::empty_base<T> > \ struct BOOST_OPERATOR2_LEFT(NAME) : B \ { \ friend T operator OP( const U& lhs, const T& rhs ) \ { return T( lhs ) OP##= rhs; } \ }; \ \ -template <class T, class B = ::boost::detail::empty_base> \ +template <class T, class B = ::boost::detail::empty_base<T> > \ struct NAME##1 : B \ { \ friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ @@ -261,7 +263,7 @@ // incrementable and decrementable contributed by Jeremy Siek -template <class T, class B = ::boost::detail::empty_base> +template <class T, class B = ::boost::detail::empty_base<T> > struct incrementable : B { friend T operator++(T& x, int) @@ -274,7 +276,7 @@ typedef T incrementable_type; }; -template <class T, class B = ::boost::detail::empty_base> +template <class T, class B = ::boost::detail::empty_base<T> > struct decrementable : B { friend T operator--(T& x, int) @@ -289,7 +291,7 @@ // Iterator operator classes (contributed by Jeremy Siek) ------------------// -template <class T, class P, class B = ::boost::detail::empty_base> +template <class T, class P, class B = ::boost::detail::empty_base<T> > struct dereferenceable : B { P operator->() const @@ -298,7 +300,7 @@ } }; -template <class T, class I, class R, class B = ::boost::detail::empty_base> +template <class T, class I, class R, class B = ::boost::detail::empty_base<T> > struct indexable : B { R operator[](I n) const @@ -313,14 +315,14 @@ #if defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) #define BOOST_BINARY_OPERATOR( NAME, OP ) \ -template <class T, class U, class B = ::boost::detail::empty_base> \ +template <class T, class U, class B = ::boost::detail::empty_base<T> > \ struct NAME##2 : B \ { \ friend T operator OP( const T& lhs, const U& rhs ) \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \ }; \ \ -template <class T, class B = ::boost::detail::empty_base> \ +template <class T, class B = ::boost::detail::empty_base<T> > \ struct NAME##1 : B \ { \ friend T operator OP( const T& lhs, const T& rhs ) \ @@ -330,13 +332,13 @@ #else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) #define BOOST_BINARY_OPERATOR( NAME, OP ) \ -template <class T, class U, class B = ::boost::detail::empty_base> \ +template <class T, class U, class B = ::boost::detail::empty_base<T> > \ struct NAME##2 : B \ { \ friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ }; \ \ -template <class T, class B = ::boost::detail::empty_base> \ +template <class T, class B = ::boost::detail::empty_base<T> > \ struct NAME##1 : B \ { \ friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \... [truncated message content] |