|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r61497 - in trunk: boost/iostreams/detail libs/iostreams/test
From: daniel_james_at_[hidden]
Date: 2010-04-22 18:51:24
Author: danieljames
Date: 2010-04-22 18:51:24 EDT (Thu, 22 Apr 2010)
New Revision: 61497
URL: http://svn.boost.org/trac/boost/changeset/61497
Log:
Only support the templated constructor for types with an
'external_string_type' member. Refs #4135.
Using SFINAE, I might add a workaround for compilers that don't support
it, although I'm not sure if there are any that Iostreams supports.
Text files modified:
trunk/boost/iostreams/detail/path.hpp | 2 +-
trunk/libs/iostreams/test/mapped_file_test.cpp | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 1 deletions(-)
Modified: trunk/boost/iostreams/detail/path.hpp
==============================================================================
--- trunk/boost/iostreams/detail/path.hpp (original)
+++ trunk/boost/iostreams/detail/path.hpp 2010-04-22 18:51:24 EDT (Thu, 22 Apr 2010)
@@ -48,7 +48,7 @@
// Constructor taking a boost::filesystem::path or boost::filesystem::wpath
template<typename Path>
- explicit path(const Path& p)
+ explicit path(const Path& p, typename Path::external_string_type* = 0)
{
typedef typename Path::external_string_type string_type;
init(p, boost::type<string_type>());
Modified: trunk/libs/iostreams/test/mapped_file_test.cpp
==============================================================================
--- trunk/libs/iostreams/test/mapped_file_test.cpp (original)
+++ trunk/libs/iostreams/test/mapped_file_test.cpp 2010-04-22 18:51:24 EDT (Thu, 22 Apr 2010)
@@ -283,6 +283,23 @@
"done reopening private mapped_file"
);
}
+
+ //-------------Check creating opening mapped_file with char*-------------//
+
+ {
+ boost::iostreams::test::test_file orig;
+ char name[50];
+ std::strcpy(name, orig.name().c_str());
+
+ mapped_file mf((char*) name);
+
+ BOOST_CHECK_MESSAGE(
+ boost::iostreams::test::test_writeable(mf),
+ "failed seeking within private mapped_file"
+ );
+
+ mf.close();
+ }
}
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
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