mirror of
https://github.com/boostorg/detail.git
synced 2025-12-20 14:02:39 +01:00
Compare commits
21 Commits
svn-branch
...
svn-branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2be78fa25d | ||
|
|
33ff8d33be | ||
|
|
ae50e20366 | ||
|
|
be9a4c47d4 | ||
|
|
eb8fdcdc91 | ||
|
|
0fee73977c | ||
|
|
2fc38490db | ||
|
|
09f98c5132 | ||
|
|
e6ddc5ae0f | ||
|
|
1a9a83f0fb | ||
|
|
17dcac2940 | ||
|
|
17df7b5b7e | ||
|
|
30f03c5423 | ||
|
|
24b07509e6 | ||
|
|
1b622c7926 | ||
|
|
c986fa4341 | ||
|
|
95b138ec61 | ||
|
|
a210e0e5c5 | ||
|
|
63a3c4ccf5 | ||
|
|
fa65f4e34c | ||
|
|
fd06013885 |
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2004 Joaqu<71>n M L<>pez Mu<4D>oz.
|
||||
/* Copyright 2003-2005 Joaqu<71>n M L<>pez Mu<4D>oz.
|
||||
* Distributed under 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)
|
||||
@@ -42,6 +42,11 @@ public:
|
||||
template<typename Other>
|
||||
partial_std_allocator_wrapper(const partial_std_allocator_wrapper<Other>&){}
|
||||
|
||||
partial_std_allocator_wrapper(const std::allocator<Type>& x):
|
||||
std::allocator<Type>(x)
|
||||
{
|
||||
};
|
||||
|
||||
#if defined(BOOST_DINKUMWARE_STDLIB)
|
||||
/* Dinkumware guys didn't provide a means to call allocate() without
|
||||
* supplying a hint, in disagreement with the standard.
|
||||
@@ -130,8 +135,10 @@ template<typename Allocator>
|
||||
struct rebinder
|
||||
{
|
||||
template<typename Type>
|
||||
struct result:Allocator::BOOST_NESTED_TEMPLATE rebind<Type>
|
||||
struct result
|
||||
{
|
||||
typedef typename Allocator::BOOST_NESTED_TEMPLATE
|
||||
rebind<Type>::other other;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
58
include/boost/detail/endian.hpp
Normal file
58
include/boost/detail/endian.hpp
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright notice reproduced from <boost/detail/limits.hpp>, from
|
||||
* which this code was originally taken.
|
||||
*
|
||||
* Modified by Caleb Epstein to use <endian.h> with GNU libc and to
|
||||
* defined the BOOST_ENDIAN macro.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_DETAIL_ENDIAN_HPP
|
||||
#define BOOST_DETAIL_ENDIAN_HPP
|
||||
|
||||
// GNU libc offers the helpful header <endian.h> which defines
|
||||
// __BYTE_ORDER
|
||||
|
||||
#if defined (__GLIBC__)
|
||||
# include <endian.h>
|
||||
# if (__BYTE_ORDER == __LITTLE_ENDIAN)
|
||||
# define BOOST_LITTLE_ENDIAN
|
||||
# elif (__BYTE_ORDER == __BIG_ENDIAN)
|
||||
# define BOOST_BIG_ENDIAN
|
||||
# elif (__BYTE_ORDER == __PDP_ENDIAN)
|
||||
# define BOOST_PDP_ENDIAN
|
||||
# else
|
||||
# error Unknown machine endianness detected.
|
||||
# endif
|
||||
# define BOOST_BYTE_ORDER __BYTE_ORDER
|
||||
#elif defined(__sparc) || defined(__sparc__) \
|
||||
|| defined(_POWER) || defined(__powerpc__) \
|
||||
|| defined(__ppc__) || defined(__hppa) \
|
||||
|| defined(_MIPSEB) || defined(_POWER) \
|
||||
|| defined(__s390__)
|
||||
# define BOOST_BIG_ENDIAN
|
||||
# define BOOST_BYTE_ORDER 4321
|
||||
#elif defined(__i386__) || defined(__alpha__) \
|
||||
|| defined(__ia64) || defined(__ia64__) \
|
||||
|| defined(_M_IX86) || defined(_M_IA64) \
|
||||
|| defined(_M_ALPHA)
|
||||
# define BOOST_LITTLE_ENDIAN
|
||||
# define BOOST_BYTE_ORDER 1234
|
||||
#else
|
||||
# error The file boost/detail/endian.hpp needs to be set up for your CPU type.
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -11,6 +11,7 @@
|
||||
# include <boost/type_traits/is_const.hpp>
|
||||
# include <boost/type_traits/is_volatile.hpp>
|
||||
# include <boost/type_traits/is_member_function_pointer.hpp>
|
||||
# include <boost/type_traits/is_member_pointer.hpp>
|
||||
# include <boost/type_traits/remove_cv.hpp>
|
||||
# include <boost/type_traits/remove_reference.hpp>
|
||||
# include <boost/type_traits/remove_pointer.hpp>
|
||||
@@ -18,6 +19,7 @@
|
||||
# include <boost/type_traits/detail/ice_and.hpp>
|
||||
# include <boost/detail/workaround.hpp>
|
||||
|
||||
# include <boost/mpl/eval_if.hpp>
|
||||
# include <boost/mpl/if.hpp>
|
||||
# include <boost/mpl/bool.hpp>
|
||||
# include <boost/mpl/and.hpp>
|
||||
@@ -251,6 +253,7 @@ struct is_reference_to_function_aux
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value = sizeof(detail::is_function_ref_tester(t,0)) == sizeof(::boost::type_traits::yes_type));
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
@@ -330,6 +333,8 @@ struct is_reference_to_non_const_helper1
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value
|
||||
= sizeof(reference_to_const_helper(t)) == sizeof(inner_no_type));
|
||||
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -343,6 +348,7 @@ template <class T>
|
||||
struct is_reference_to_non_const
|
||||
: is_reference_to_non_const_helper1<is_reference<T>::value>::template apply<T>
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_non_const,(T))
|
||||
};
|
||||
|
||||
|
||||
@@ -361,6 +367,7 @@ struct is_reference_to_volatile_helper1
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value
|
||||
= sizeof(reference_to_volatile_helper(t)) == sizeof(inner_yes_type));
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -389,12 +396,16 @@ struct is_reference_to_pointer
|
||||
= (is_reference<T>::value
|
||||
&& sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type))
|
||||
);
|
||||
|
||||
typedef mpl::bool_<value> type;
|
||||
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_pointer,(T))
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_reference_to_function_pointer
|
||||
: mpl::if_<
|
||||
is_reference<T>
|
||||
is_reference<T>
|
||||
, is_pointer_to_function_aux<T>
|
||||
, mpl::bool_<false>
|
||||
>::type
|
||||
@@ -463,6 +474,7 @@ struct is_pointer_to_class
|
||||
= (is_pointer<T>::value
|
||||
&& sizeof(pointer_to_class_helper(t)) == sizeof(inner_yes_type))
|
||||
);
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
|
||||
90
include/boost/detail/interlocked.hpp
Normal file
90
include/boost/detail/interlocked.hpp
Normal file
@@ -0,0 +1,90 @@
|
||||
#ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
||||
#define BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/detail/interlocked.hpp
|
||||
//
|
||||
// Copyright 2005 Peter Dimov
|
||||
//
|
||||
// Distributed under 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)
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_USE_WINDOWS_H )
|
||||
|
||||
# include <windows.h>
|
||||
|
||||
# define BOOST_INTERLOCKED_INCREMENT ::InterlockedIncrement
|
||||
# define BOOST_INTERLOCKED_DECREMENT ::InterlockedDecrement
|
||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE ::InterlockedCompareExchange
|
||||
# define BOOST_INTERLOCKED_EXCHANGE ::InterlockedExchange
|
||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER ::InterlockedCompareExchangePointer
|
||||
|
||||
#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
|
||||
|
||||
extern "C" long __cdecl _InterlockedIncrement( long volatile * );
|
||||
extern "C" long __cdecl _InterlockedDecrement( long volatile * );
|
||||
extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long );
|
||||
extern "C" long __cdecl _InterlockedExchange( long volatile *, long);
|
||||
|
||||
# pragma intrinsic( _InterlockedIncrement )
|
||||
# pragma intrinsic( _InterlockedDecrement )
|
||||
# pragma intrinsic( _InterlockedCompareExchange )
|
||||
# pragma intrinsic( _InterlockedExchange )
|
||||
# if defined(_M_IA64) || defined(_M_AMD64)
|
||||
extern "C" void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* );
|
||||
# pragma intrinsic( _InterlockedCompareExchangePointer )
|
||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER ::_InterlockedCompareExchangePointer
|
||||
# else
|
||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
|
||||
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
|
||||
# endif
|
||||
|
||||
# define BOOST_INTERLOCKED_INCREMENT ::_InterlockedIncrement
|
||||
# define BOOST_INTERLOCKED_DECREMENT ::_InterlockedDecrement
|
||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE ::_InterlockedCompareExchange
|
||||
# define BOOST_INTERLOCKED_EXCHANGE ::_InterlockedExchange
|
||||
|
||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * );
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * );
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long );
|
||||
extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long );
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
# define BOOST_INTERLOCKED_INCREMENT ::boost::detail::InterlockedIncrement
|
||||
# define BOOST_INTERLOCKED_DECREMENT ::boost::detail::InterlockedDecrement
|
||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE ::boost::detail::InterlockedCompareExchange
|
||||
# define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange
|
||||
# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
|
||||
((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
|
||||
|
||||
#else
|
||||
|
||||
# error "Interlocked intrinsics not available"
|
||||
|
||||
#endif
|
||||
|
||||
#define BOOST_INTERLOCKED_READ(x) BOOST_INTERLOCKED_COMPARE_EXCHANGE(x,0,0)
|
||||
#define BOOST_INTERLOCKED_READ_POINTER(x) BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(x,0,0)
|
||||
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_INTERLOCKED_HPP_INCLUDED
|
||||
@@ -4,7 +4,10 @@
|
||||
#ifndef IS_INCREMENTABLE_DWA200415_HPP
|
||||
# define IS_INCREMENTABLE_DWA200415_HPP
|
||||
|
||||
# include <boost/type_traits/detail/bool_trait_def.hpp>
|
||||
# include <boost/type_traits/detail/template_arity_spec.hpp>
|
||||
# include <boost/type_traits/remove_cv.hpp>
|
||||
# include <boost/mpl/aux_/lambda_support.hpp>
|
||||
# include <boost/mpl/bool.hpp>
|
||||
# include <boost/detail/workaround.hpp>
|
||||
|
||||
@@ -51,7 +54,7 @@ namespace is_incrementable_
|
||||
template <class T>
|
||||
struct impl
|
||||
{
|
||||
static typename remove_cv<T>::type& x;
|
||||
static typename boost::remove_cv<T>::type& x;
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool
|
||||
@@ -62,7 +65,7 @@ namespace is_incrementable_
|
||||
template <class T>
|
||||
struct postfix_impl
|
||||
{
|
||||
static typename remove_cv<T>::type& x;
|
||||
static typename boost::remove_cv<T>::type& x;
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool
|
||||
@@ -73,18 +76,28 @@ namespace is_incrementable_
|
||||
|
||||
# undef BOOST_comma
|
||||
|
||||
template <class T>
|
||||
struct is_incrementable
|
||||
: mpl::bool_< ::boost::detail::is_incrementable_::impl<T>::value>
|
||||
{
|
||||
template<typename T>
|
||||
struct is_incrementable
|
||||
BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl<T>::value)
|
||||
{
|
||||
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::impl<T>::value)
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_incrementable,(T))
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_postfix_incrementable
|
||||
: mpl::bool_< ::boost::detail::is_incrementable_::postfix_impl<T>::value>
|
||||
{
|
||||
template<typename T>
|
||||
struct is_postfix_incrementable
|
||||
BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl<T>::value)
|
||||
{
|
||||
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::postfix_impl<T>::value)
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_postfix_incrementable,(T))
|
||||
};
|
||||
|
||||
}} // namespace boost::detail
|
||||
} // namespace detail
|
||||
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_incrementable)
|
||||
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_postfix_incrementable)
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // IS_INCREMENTABLE_DWA200415_HPP
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
// Copyright © 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
||||
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). Permission to copy,
|
||||
// use, modify, sell and distribute this software is granted provided this
|
||||
// copyright notice appears in all copies. This software is provided "as is"
|
||||
// without express or implied warranty, and with no claim as to its suitability
|
||||
// for any purpose.
|
||||
|
||||
#ifndef BOOST_UTF8_CODECVT_FACET_HPP
|
||||
#define BOOST_UTF8_CODECVT_FACET_HPP
|
||||
|
||||
@@ -9,12 +16,38 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// utf8_codecvt_facet.hpp
|
||||
|
||||
// Copyright © 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
||||
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). Permission to copy,
|
||||
// use, modify, sell and distribute this software is granted provided this
|
||||
// copyright notice appears in all copies. This software is provided "as is"
|
||||
// without express or implied warranty, and with no claim as to its suitability
|
||||
// for any purpose.
|
||||
// This header defines class utf8_codecvt_facet, derived fro
|
||||
// std::codecvt<wchar_t, char>, which can be used to convert utf8 data in
|
||||
// files into wchar_t strings in the application.
|
||||
//
|
||||
// The header is NOT STANDALONE, and is not to be included by the USER.
|
||||
// There are at least two libraries which want to use this functionality, and
|
||||
// we want to avoid code duplication. It would be possible to create utf8
|
||||
// library, but:
|
||||
// - this requires review process first
|
||||
// - in the case, when linking the a library which uses utf8
|
||||
// (say 'program_options'), user should also link to the utf8 library.
|
||||
// This seems inconvenient, and asking a user to link to an unrevieved
|
||||
// library is strange.
|
||||
// Until the above points are fixed, a library which wants to use utf8 must:
|
||||
// - include this header from one of it's headers or sources
|
||||
// - include the corresponding .cpp file from one of the sources
|
||||
// - before including either file, the library must define
|
||||
// - BOOST_UTF8_BEGIN_NAMESPACE to the namespace declaration that must be used
|
||||
// - BOOST_UTF8_END_NAMESPACE to the code to close the previous namespace
|
||||
// - declaration.
|
||||
// - BOOST_UTF8_DECL -- to the code which must be used for all 'exportable'
|
||||
// symbols.
|
||||
//
|
||||
// For example, program_options library might contain:
|
||||
// #define BOOST_UTF8_BEGIN_NAMESPACE <backslash character>
|
||||
// namespace boost { namespace program_options {
|
||||
// #define BOOST_UTF8_END_NAMESPACE }}
|
||||
// #define BOOST_UTF8_DECL BOOST_PROGRAM_OPTIONS_DECL
|
||||
// #include "../../detail/utf8/utf8_codecvt.cpp"
|
||||
//
|
||||
// Essentially, each library will have its own copy of utf8 code, in
|
||||
// different namespaces.
|
||||
|
||||
// Note:(Robert Ramey). I have made the following alterations in the original
|
||||
// code.
|
||||
@@ -48,39 +81,42 @@
|
||||
// specialized on those types for this to work.
|
||||
|
||||
#include <locale>
|
||||
#include <cstddef> // size_t
|
||||
// for mbstate_t
|
||||
#include <wchar.h>
|
||||
// for std::size_t
|
||||
#include <cstddef>
|
||||
|
||||
namespace std{
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
namespace std {
|
||||
#if defined(__LIBCOMO__)
|
||||
using ::mbstate_t;
|
||||
#elif defined(BOOST_DINKUMWARE_STDLIB)
|
||||
using ::mbstate_t;
|
||||
#elif defined(__SGI_STL_PORT)
|
||||
#elif defined(BOOST_NO_STDC_NAMESPACE)
|
||||
using ::codecvt;
|
||||
using ::mbstate_t;
|
||||
using ::codecvt;
|
||||
#endif
|
||||
} // namespace std
|
||||
|
||||
|
||||
#if !defined(__MSL_CPP__) \
|
||||
&& !defined(__LIBCOMO__)
|
||||
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
|
||||
#define BOOST_CODECVT_DO_LENGTH_CONST const
|
||||
#else
|
||||
#define BOOST_CODECVT_DO_LENGTH_CONST
|
||||
#endif
|
||||
|
||||
#include <boost/integer_traits.hpp>
|
||||
|
||||
|
||||
// maximum lenght of a multibyte string
|
||||
#define MB_LENGTH_MAX 8
|
||||
|
||||
struct utf8_codecvt_facet_wchar_t :
|
||||
BOOST_UTF8_BEGIN_NAMESPACE
|
||||
|
||||
struct BOOST_UTF8_DECL utf8_codecvt_facet :
|
||||
public std::codecvt<wchar_t, char, std::mbstate_t>
|
||||
{
|
||||
public:
|
||||
explicit utf8_codecvt_facet_wchar_t(std::size_t no_locale_manage = 0)
|
||||
explicit utf8_codecvt_facet(std::size_t no_locale_manage=0)
|
||||
: std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage)
|
||||
{}
|
||||
protected:
|
||||
@@ -128,7 +164,8 @@ protected:
|
||||
char * from,
|
||||
char * to,
|
||||
char * & next
|
||||
) const{
|
||||
) const
|
||||
{
|
||||
next = from;
|
||||
return ok;
|
||||
}
|
||||
@@ -145,7 +182,11 @@ protected:
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
std::size_t max_limit
|
||||
) const throw();
|
||||
#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
|
||||
) const throw();
|
||||
#else
|
||||
) const;
|
||||
#endif
|
||||
|
||||
// Largest possible value do_length(state,from,from_end,1) could return.
|
||||
virtual int do_max_length() const throw () {
|
||||
@@ -153,63 +194,6 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
#if 0 // not used - incorrect in any case
|
||||
// Robert Ramey - use the above to make a code converter from multi-byte
|
||||
// char strings to utf8 encoding
|
||||
struct utf8_codecvt_facet_char : public utf8_codecvt_facet_wchar_t
|
||||
{
|
||||
typedef utf8_codecvt_facet_wchar_t base_class;
|
||||
public:
|
||||
explicit utf8_codecvt_facet_char(std::size_t no_locale_manage=0)
|
||||
: base_class(no_locale_manage)
|
||||
{}
|
||||
protected:
|
||||
virtual std::codecvt_base::result do_in(
|
||||
std::mbstate_t & state,
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
const char * & from_next,
|
||||
char * to,
|
||||
char * to_end,
|
||||
char * & to_next
|
||||
) const;
|
||||
|
||||
virtual std::codecvt_base::result do_out(
|
||||
std::mbstate_t & state,
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
const char* & from_next,
|
||||
char * to,
|
||||
char * to_end,
|
||||
char * & to_next
|
||||
) const;
|
||||
|
||||
// How many char objects can I process to get <= max_limit
|
||||
// char objects?
|
||||
virtual int do_length(
|
||||
const std::mbstate_t&,
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
std::size_t max_limit
|
||||
) const;
|
||||
};
|
||||
#endif
|
||||
|
||||
template<class Internal, class External>
|
||||
struct utf8_codecvt_facet
|
||||
{};
|
||||
|
||||
template<>
|
||||
struct utf8_codecvt_facet<wchar_t, char>
|
||||
: public utf8_codecvt_facet_wchar_t
|
||||
{};
|
||||
|
||||
#if 0
|
||||
template<>
|
||||
struct utf8_codecvt_facet<char, char>
|
||||
: public utf8_codecvt_facet_char
|
||||
{};
|
||||
#endif
|
||||
BOOST_UTF8_END_NAMESPACE
|
||||
|
||||
#endif // BOOST_UTF8_CODECVT_FACET_HPP
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
// Copyright David Abrahams 2004. Use, modification and distribution is
|
||||
// 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)
|
||||
#ifndef INDIRECT_REFERENCE_DWA200415_HPP
|
||||
# define INDIRECT_REFERENCE_DWA200415_HPP
|
||||
|
||||
// dereferenceable_traits provides access to the value_type and
|
||||
// reference of a Dereferenceable type.
|
||||
//
|
||||
// Copyright David Abrahams 2004. Use, modification and distribution is
|
||||
// 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)
|
||||
//
|
||||
// typename indirect_reference<P>::type provides the type of *p.
|
||||
//
|
||||
// http://www.boost.org/libs/iterator/doc/pointee.html
|
||||
//
|
||||
|
||||
# include <boost/detail/is_incrementable.hpp>
|
||||
# include <boost/iterator/iterator_traits.hpp>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// -*- C++ -*- forwarding header.
|
||||
// (C) Copyright Jeremy Siek 2004
|
||||
// Distributed under 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)
|
||||
|
||||
#ifndef BOOST_CSTDDEF_HPP
|
||||
#define BOOST_CSTDDEF_HPP
|
||||
|
||||
@@ -19,13 +19,12 @@
|
||||
problem.
|
||||
*/
|
||||
|
||||
#include <boost/type_traits/integral_constant.hpp> // true_type and false_type
|
||||
|
||||
namespace boost {
|
||||
|
||||
struct ct_if_error { };
|
||||
|
||||
struct true_type { enum { value = true }; };
|
||||
struct false_type { enum { value = false }; };
|
||||
|
||||
template <class A, class B>
|
||||
struct ct_and { typedef false_type type; };
|
||||
template <> struct ct_and<true_type,true_type> { typedef true_type type; };
|
||||
|
||||
Reference in New Issue
Block a user