|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63226 - trunk/boost/filesystem/v3
From: bdawes_at_[hidden]
Date: 2010-06-22 06:56:52
Author: bemandawes
Date: 2010-06-22 06:56:51 EDT (Tue, 22 Jun 2010)
New Revision: 63226
URL: http://svn.boost.org/trac/boost/changeset/63226
Log:
Workaround for IBM, old GCC, and other non-conforming compilers.
Text files modified:
trunk/boost/filesystem/v3/path_traits.hpp | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
Modified: trunk/boost/filesystem/v3/path_traits.hpp
==============================================================================
--- trunk/boost/filesystem/v3/path_traits.hpp (original)
+++ trunk/boost/filesystem/v3/path_traits.hpp 2010-06-22 06:56:51 EDT (Tue, 22 Jun 2010)
@@ -11,12 +11,14 @@
#define BOOST_FILESYSTEM_PATH_TRAITS_HPP
#include <boost/filesystem/v3/config.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_array.hpp>
+#include <boost/system/error_code.hpp>
#include <string>
#include <vector>
#include <iterator>
#include <locale>
#include <boost/assert.hpp>
-#include <boost/system/error_code.hpp>
// #include <iostream> //**** comment me out ****
#include <boost/config/abi_prefix.hpp> // must be the last #include
@@ -43,8 +45,11 @@
// Pathable empty
template <class Container> inline
- bool empty(const Container & c)
- { return c.begin() == c.end(); }
+ // disable_if aids broken compilers (IBM, old GCC, etc.) and is harmless for
+ // conforming compilers. Replace by plain "bool" at some future date (2012?)
+ typename boost::disable_if<boost::is_array<Container>, bool>::type
+ empty(const Container & c)
+ { return c.begin() == c.end(); }
template <class T> inline
bool empty(T * const & c_str)
@@ -163,7 +168,10 @@
// non-contiguous containers
template <class Container, class U> inline
- void dispatch(const Container & c, U& to, const codecvt_type& cvt)
+ // disable_if aids broken compilers (IBM, old GCC, etc.) and is harmless for
+ // conforming compilers. Replace by plain "void" at some future date (2012?)
+ typename boost::disable_if<boost::is_array<Container>, void>::type
+ dispatch(const Container & c, U& to, const codecvt_type& cvt)
{
if (c.size())
{
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk