|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r54902 - in sandbox/SOC/2009/unicode: boost/introspection boost/iterator boost/unicode libs/unicode/src
From: eric_at_[hidden]
Date: 2009-07-11 18:46:05
Author: eric_niebler
Date: 2009-07-11 18:46:04 EDT (Sat, 11 Jul 2009)
New Revision: 54902
URL: http://svn.boost.org/trac/boost/changeset/54902
Log:
portability fixes
Text files modified:
sandbox/SOC/2009/unicode/boost/introspection/has_member_data.hpp | 6 +++---
sandbox/SOC/2009/unicode/boost/iterator/pipe_iterator.hpp | 11 ++++++-----
sandbox/SOC/2009/unicode/boost/unicode/hangul.hpp | 5 +++--
sandbox/SOC/2009/unicode/boost/unicode/utf_codecs.hpp | 9 +++++----
sandbox/SOC/2009/unicode/libs/unicode/src/unicode_blocks.cpp | 7 +++++++
5 files changed, 24 insertions(+), 14 deletions(-)
Modified: sandbox/SOC/2009/unicode/boost/introspection/has_member_data.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/introspection/has_member_data.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/introspection/has_member_data.hpp 2009-07-11 18:46:04 EDT (Sat, 11 Jul 2009)
@@ -23,7 +23,7 @@
template<class X> static NotFound test( ... ); \
\
static const bool value = (sizeof(Found) == sizeof(test<T>(0))); \
- typedef mpl::bool_<value> type; \
+ typedef boost::mpl::bool_<value> type; \
}; \
/**/
@@ -33,13 +33,13 @@
typedef char NotFound; \
struct Found { char x[2]; }; \
\
- template< class X, Type*> struct member {}; \
+ template< class X, Type*> struct member {}; \
\
template<class X> static Found test(member<X,&X::Name>*); \
template<class X> static NotFound test( ... ); \
\
static const bool value = (sizeof(Found) == sizeof(test<T>(0))); \
- typedef mpl::bool_<value> type; \
+ typedef boost::mpl::bool_<value> type; \
}; \
/**/
Modified: sandbox/SOC/2009/unicode/boost/iterator/pipe_iterator.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/iterator/pipe_iterator.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/iterator/pipe_iterator.hpp 2009-07-11 18:46:04 EDT (Sat, 11 Jul 2009)
@@ -11,25 +11,26 @@
#include <boost/introspection/has_member_data.hpp>
#include <boost/utility/enable_if.hpp>
+#include <boost/mpl/has_xxx.hpp>
namespace boost
{
namespace detail
{
- BOOST_HAS_STATIC_MEMBER_DATA(const int, max_output)
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(max_output)
template<typename P, typename Enable = void>
struct pipe_output_storage;
template<typename P>
- struct pipe_output_storage<P, typename ::boost::disable_if< has_static_member_data_max_output<P> >::type>
+ struct pipe_output_storage<P, typename ::boost::disable_if< has_max_output<P> >::type>
{
private:
typedef std::vector<typename P::output_type> Values;
public:
typedef std::back_insert_iterator<Values> output_iterator;
- const typename P::output_value& operator[](size_t i) const
+ const typename P::output_type& operator[](size_t i) const
{
return values[i];
}
@@ -54,7 +55,7 @@
};
template<typename P>
- struct pipe_output_storage<P, typename boost::enable_if< has_static_member_data_max_output<P> >::type>
+ struct pipe_output_storage<P, typename boost::enable_if< has_max_output<P> >::type>
{
private:
typedef typename P::output_type Value;
@@ -82,7 +83,7 @@
}
private:
- Value values[P::max_output];
+ Value values[P::max_output::value];
size_t last;
};
}
Modified: sandbox/SOC/2009/unicode/boost/unicode/hangul.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/unicode/hangul.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/unicode/hangul.hpp 2009-07-11 18:46:04 EDT (Sat, 11 Jul 2009)
@@ -6,6 +6,7 @@
* http://www.unicode.org/reports/tr15/ */
#include <boost/cuchar.hpp>
+#include <boost/mpl/int.hpp>
namespace boost
{
@@ -31,7 +32,7 @@
struct hangul_decomposer
{
typedef char32 output_type;
- static const int max_output = 3;
+ typedef mpl::int_<3> max_output;
template<typename Out>
Out operator()(char32 ch, Out out)
@@ -66,7 +67,7 @@
struct hangul_composer
{
typedef char32 output_type;
- static const int max_output = 1;
+ typedef mpl::int_<1> max_output;
/*template<typename In, typename Out>
std::pair<In, Out> ltr(In begin, In end, Out out)
Modified: sandbox/SOC/2009/unicode/boost/unicode/utf_codecs.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/unicode/utf_codecs.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/unicode/utf_codecs.hpp 2009-07-11 18:46:04 EDT (Sat, 11 Jul 2009)
@@ -3,6 +3,7 @@
#include <boost/assert.hpp>
#include <boost/throw_exception.hpp>
+#include <boost/mpl/int.hpp>
#include <stdexcept>
#ifndef BOOST_NO_STD_LOCALE
#include <sstream>
@@ -78,7 +79,7 @@
struct u16_encoder
{
typedef char16 output_type;
- static const int max_output = 2;
+ typedef mpl::int_<2> max_output;
/** Throws std::out_of_range if \c v is not a valid code point. */
template<typename OutputIterator>
@@ -120,7 +121,7 @@
struct u16_decoder
{
typedef char32 output_type;
- static const int max_output = 1;
+ typedef mpl::int_<1> max_output;
/** Throws std::out_of_range if [<tt>begin</tt>, <tt>end</tt>[ is not a valid UTF-16 range. */
template<typename In, typename Out>
@@ -212,7 +213,7 @@
struct u8_encoder
{
typedef char output_type;
- static const int max_output = 4;
+ typedef mpl::int_<4> max_output;
/** Throws std::out_of_range if \c c is not a valid code point. */
template<typename OutputIterator>
@@ -253,7 +254,7 @@
struct u8_decoder
{
typedef char32 output_type;
- static const int max_output = 1;
+ typedef mpl::int_<1> max_output;
private:
template<typename In>
Modified: sandbox/SOC/2009/unicode/libs/unicode/src/unicode_blocks.cpp
==============================================================================
--- sandbox/SOC/2009/unicode/libs/unicode/src/unicode_blocks.cpp (original)
+++ sandbox/SOC/2009/unicode/libs/unicode/src/unicode_blocks.cpp 2009-07-11 18:46:04 EDT (Sat, 11 Jul 2009)
@@ -8,6 +8,8 @@
{
struct block_find
{
+ typedef bool result_type;
+
bool operator()(const boost::unicode::ucd::unichar_blocks_internal& a, const boost::unicode::ucd::unichar_blocks_internal& b) const
{
return a.first < b.first;
@@ -17,6 +19,11 @@
{
return a.first < b;
}
+
+ bool operator()(char32 a, const boost::unicode::ucd::unichar_blocks_internal& b) const
+ {
+ return a < b.first;
+ }
};
}
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