+2003-08-07 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * configure.ac (AH_BOTTOM): do not use BOOST_NO_EXCEPTIONS
+ here, that is done by boost gcc config.
+
2003-08-05 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* configure.ac: add $(EXEEXT) to program names in FRONTEND_PROGS
should be built
(AC_CONFIG_FILES): output lyx_forms.h-tmp instead of lyx_forms.h
in order to do dependency trick in xforms frontend (same for
- lyx_xpm.h)
+ lyx_xpm.h)
2003-07-31 John Levon <levon@movementarian.org>
+2003-08-07 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * boost/config/user.hpp: do not use BOOST_NO_EXCEPTIONS here, that
+ is done automatically by the gcc config.
+
+ * boost/config/compiler/gcc.hpp: allow for gcc 2.4
+
+ * update boost to version 1.30.1
+
2003-07-18 Lars Gullik Bjønnes <larsbj@gullik.net>
* libs/regex/src/cpp_regex_traits.cpp (message_data): cast to safe
- types
+ types
* libs/regex/src/c_regex_traits.cpp (do_update_ctype): cast to
safe types.
2003-03-21 Lars Gullik Bjønnes <larsbj@gullik.net>
- * update boot so version 1.30.0
+ * update boost to version 1.30.0
2003-03-11 Lars Gullik Bjønnes <larsbj@gullik.net>
#ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED
#define BOOST_CHECKED_DELETE_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
template<class T> inline void checked_delete(T * x)
{
- typedef char type_must_be_complete[sizeof(T)];
+ // Intel 7 accepts sizeof(incomplete) as 0 in system headers
+ typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
delete x;
}
template<class T> inline void checked_array_delete(T * x)
{
- typedef char type_must_be_complete[sizeof(T)];
+ typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
delete [] x;
}
void operator()(T * x) const
{
+ // boost:: disables ADL
boost::checked_delete(x);
}
};
# define BOOST_NO_OPERATORS_IN_NAMESPACE
# endif
+# if __GNUC__ < 3
+# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
+# endif
+
+#ifndef __EXCEPTIONS
+# define BOOST_NO_EXCEPTIONS
+#endif
+
+//
+// Bug specific to gcc 3.1 and 3.2:
+//
+#if (__GNUC__ == 3) && ((__GNUC_MINOR__ == 1) || (__GNUC_MINOR__ == 2))
+# define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+#endif
+
//
// Threading support: Turn this on unconditionally here (except for
-// MinGW, where we can know for sure). It will get turned off again
+// those platforms where we can know for sure). It will get turned off again
// later if no threading API is detected.
//
-#if !defined(__MINGW32__) || defined(_MT)
+#if !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(linux) && !defined(__linux) && !defined(__linux__)
# define BOOST_HAS_THREADS
#endif
# error "Compiler not configured - please reconfigure"
#endif
//
-// last known and checked version is 3.2:
+// last known and checked version is 3.3:
#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 4))
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
// #define BOOST_DISABLE_WIN32
-#define BOOST_NO_EXCEPTIONS 1
#define BOOST_NO_WREGEX 1
#define BOOST_NO_WSTRING 1
+++ /dev/null
-// (C) Copyright David Abrahams and Jeremy Siek 2000-2001. 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.
-//
-// See http://www.boost.org/libs/utility/counting_iterator.htm for documentation.
-//
-// Supplies:
-//
-// template <class Incrementable> class counting_iterator_traits;
-// template <class Incrementable> class counting_iterator_policies;
-//
-// Iterator traits and policies for adapted iterators whose dereferenced
-// value progresses through consecutive values of Incrementable when the
-// iterator is derferenced.
-//
-// template <class Incrementable> struct counting_iterator_generator;
-//
-// A "type generator" whose nested type "type" is a counting iterator as
-// described above.
-//
-// template <class Incrementable>
-// typename counting_iterator_generator<Incrementable>::type
-// make_counting_iterator(Incrementable);
-//
-// A function which produces an adapted counting iterator over values of
-// Incrementable.
-//
-// Revision History
-// 14 Feb 2001 Removed unnecessary typedefs from counting_iterator_traits
-// (Jeremy Siek)
-// 11 Feb 2001 Use BOOST_STATIC_CONSTANT (Dave Abrahams)
-// 11 Feb 2001 Clean up after John Maddocks's (finally effective!) Borland
-// fixes (David Abrahams).
-// 10 Feb 2001 Use new iterator_adaptor<> interface (David Abrahams)
-// 10 Feb 2001 Rolled in supposed Borland fixes from John Maddock, but not
-// seeing any improvement yet (David Abrahams)
-// 09 Feb 2001 Factored out is_numeric computation. Borland still
-// unhappy :( (David Abrahams)
-// 08 Feb 2001 Beginning of a failed attempt to appease Borland
-// (David Abrahams)
-// 07 Feb 2001 rename counting_iterator() -> make_counting_iterator()
-// (David Abrahams)
-// 04 Feb 2001 Added counting_iterator_generator; updated comments
-// (David Abrahams)
-// 24 Jan 2001 initial revision, based on Jeremy Siek's
-// boost/pending/integer_range.hpp (David Abrahams)
-
-#ifndef BOOST_COUNTING_ITERATOR_HPP_DWA20000119
-# define BOOST_COUNTING_ITERATOR_HPP_DWA20000119
-
-# include <boost/config.hpp>
-# include <boost/detail/iterator.hpp>
-# include <boost/iterator_adaptors.hpp>
-# include <boost/type_traits.hpp>
-# include <boost/detail/numeric_traits.hpp>
-# include <boost/static_assert.hpp>
-# include <boost/limits.hpp>
-
-namespace boost {
-
-namespace detail {
-
- // Template class counting_iterator_traits_select -- choose an
- // iterator_category and difference_type for a counting_iterator at
- // compile-time based on whether or not it wraps an integer or an iterator,
- // using "poor man's partial specialization".
- template <bool is_integer> struct counting_iterator_traits_select;
-
- // Incrementable is an iterator type
- template <>
- struct counting_iterator_traits_select<false>
- {
- template <class Incrementable>
- struct traits
- {
- private:
- typedef boost::detail::iterator_traits<Incrementable> x;
- public:
- typedef typename x::iterator_category iterator_category;
- typedef typename x::difference_type difference_type;
- };
- };
-
- // Incrementable is a numeric type
- template <>
- struct counting_iterator_traits_select<true>
- {
- template <class Incrementable>
- struct traits
- {
- typedef typename
- boost::detail::numeric_traits<Incrementable>::difference_type
- difference_type;
- typedef std::random_access_iterator_tag iterator_category;
- };
- };
-
- // Template class distance_policy_select -- choose a policy for computing the
- // distance between counting_iterators at compile-time based on whether or not
- // the iterator wraps an integer or an iterator, using "poor man's partial
- // specialization".
-
- template <bool is_integer> struct distance_policy_select;
-
- // A policy for wrapped iterators
- template <>
- struct distance_policy_select<false>
- {
- template <class Distance, class Incrementable>
- struct policy {
- static Distance distance(Incrementable x, Incrementable y)
- { return boost::detail::distance(x, y); }
- };
- };
-
- // A policy for wrapped numbers
- template <>
- struct distance_policy_select<true>
- {
- template <class Distance, class Incrementable>
- struct policy {
- static Distance distance(Incrementable x, Incrementable y)
- { return numeric_distance(x, y); }
- };
- };
-
- // Try to detect numeric types at compile time in ways compatible with the
- // limitations of the compiler and library.
- template <class T>
- struct is_numeric {
- // For a while, this wasn't true, but we rely on it below. This is a regression assert.
- BOOST_STATIC_ASSERT(::boost::is_integral<char>::value);
-# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
-# if defined(BOOST_HAS_LONG_LONG)
- BOOST_STATIC_CONSTANT(bool,
- value = (
- std::numeric_limits<T>::is_specialized
- | boost::is_same<T,long long>::value
- | boost::is_same<T,unsigned long long>::value));
-# else
- BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits<T>::is_specialized);
-# endif
-# else
-# if !defined(__BORLANDC__)
- BOOST_STATIC_CONSTANT(bool, value = (
- boost::is_convertible<int,T>::value && boost::is_convertible<T,int>::value));
-# else
- BOOST_STATIC_CONSTANT(bool, value = ::boost::is_arithmetic<T>::value);
-# endif
-# endif
- };
-
- // Compute the distance over arbitrary numeric and/or iterator types
- template <class Distance, class Incrementable>
- Distance any_distance(Incrementable start, Incrementable finish, Distance* = 0)
- {
-
- return distance_policy_select<(
- is_numeric<Incrementable>::value)>::template
- policy<Distance, Incrementable>::distance(start, finish);
- }
-
-} // namespace detail
-
-template <class Incrementable>
-struct counting_iterator_traits {
- private:
- typedef ::boost::detail::counting_iterator_traits_select<(
- ::boost::detail::is_numeric<Incrementable>::value
- )> binder;
- typedef typename binder::template traits<Incrementable> traits;
- public:
- typedef typename traits::difference_type difference_type;
- typedef typename traits::iterator_category iterator_category;
-};
-
-template <class Incrementable>
-struct counting_iterator_policies : public default_iterator_policies
-{
- template <class IteratorAdaptor>
- typename IteratorAdaptor::reference dereference(const IteratorAdaptor& i) const
- { return i.base(); }
-
- template <class Iterator1, class Iterator2>
- typename Iterator1::difference_type distance(
- const Iterator1& x, const Iterator2& y) const
- {
- typedef typename Iterator1::difference_type difference_type;
- return boost::detail::any_distance<difference_type>(
- x.base(), y.base());
- }
-};
-
-// A type generator for counting iterators
-template <class Incrementable>
-struct counting_iterator_generator
-{
- typedef typename boost::remove_const<
- Incrementable
- >::type value_type;
-
- typedef counting_iterator_traits<value_type> traits;
-
- typedef iterator_adaptor<
- value_type
- , counting_iterator_policies<value_type>
- , value_type
- , value_type const&
- , value_type const*
- , typename traits::iterator_category
- , typename traits::difference_type
- > type;
-};
-
-// Manufacture a counting iterator for an arbitrary incrementable type
-template <class Incrementable>
-inline typename counting_iterator_generator<Incrementable>::type
-make_counting_iterator(Incrementable x)
-{
- typedef typename counting_iterator_generator<Incrementable>::type result_t;
- return result_t(x);
-}
-
-
-} // namespace boost
-
-#endif // BOOST_COUNTING_ITERATOR_HPP_DWA20000119
#ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
#define BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
//
// (BOOST_MSVC) != 0 && (BOOST_MSVC) <= 1200
//
-// When used for workarounds on the latest known version of a
-// compiler, the following convention should be observed:
+// When used for workarounds that apply to the latest known version
+// and all earlier versions of a compiler, the following convention
+// should be observed:
//
// #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1301))
//
// The version number in this case corresponds to the last version in
-// which the workaround was known to have been required. It only has
-// value as a comment unless BOOST_DETECT_OUTDATED_WORKAROUNDS is
-// defined, in which case a compiler warning or error will be issued
-// when the compiler version exceeds the argument to BOOST_TESTED_AT
+// which the workaround was known to have been required. When
+// BOOST_DETECT_OUTDATED_WORKAROUNDS is not the defined, the macro
+// BOOST_TESTED_AT(x) expands to "!= 0", which effectively activates
+// the workaround for any version of the compiler. When
+// BOOST_DETECT_OUTDATED_WORKAROUNDS is defined, a compiler warning or
+// error will be issued if the compiler version exceeds the argument
+// to BOOST_TESTED_AT(). This can be used to locate workarounds which
+// may be obsoleted by newer versions.
# ifndef BOOST_STRICT_CONFIG
// broken preprocessor in MWCW 8.3 and earlier.
//
// The basic mechanism works as follows:
-// (symbol test) + 1 => 2 if the test passes, 1 otherwise
-// 1 % ((symbol test) + 1) => 1 if the test passes, 0 otherwise
+// (symbol test) + 1 => if (symbol test) then 2 else 1
+// 1 % ((symbol test) + 1) => if (symbol test) then 1 else 0
//
// The complication with % is for cooperation with BOOST_TESTED_AT().
// When "test" is BOOST_TESTED_AT(x) and
// BOOST_DETECT_OUTDATED_WORKAROUNDS is #defined,
//
-// symbol test => 1 if symbol <= x, -1 otherwise
-// (symbol test) + 1 => 2 if symbol <= x, 0 otherwise
-// 1 % ((symbol test) + 1) => 1 if symbol <= x, zero divide otherwise
+// symbol test => if (symbol <= x) then 1 else -1
+// (symbol test) + 1 => if (symbol <= x) then 2 else 0
+// 1 % ((symbol test) + 1) => if (symbol <= x) then 1 else divide-by-zero
//
# ifdef BOOST_DETECT_OUTDATED_WORKAROUNDS
{
oss_.imbue( loc );
state0_.set_by_stream(oss_);
- parse(s);
+ parse(s);
}
#endif //BOOST_NO_STD_LOCALE
items_(), oss_(), exceptions_(io::all_error_bits)
{
state0_.set_by_stream(oss_);
- parse(s);
+ parse(s);
}
template< class Ch, class Tr>
basic_format<Ch, Tr> :: basic_format(const basic_format& x)
- : style_(x.style_), cur_arg_(x.cur_arg_), num_args_(x.num_args_), dumped_(false),
- items_(x.items_), prefix_(x.prefix_), bound_(x.bound_),
+ : style_(x.style_), cur_arg_(x.cur_arg_), num_args_(x.num_args_), dumped_(false),
+ items_(x.items_), prefix_(x.prefix_), bound_(x.bound_),
oss_(), // <- we obviously can't copy x.oss_
state0_(x.state0_), exceptions_(x.exceptions_)
-{
+{
state0_.apply_on(oss_);
-}
+}
template< class Ch, class Tr>
basic_format<Ch, Tr>& basic_format<Ch, Tr> ::operator= (const basic_format& x)
items_ = x.items_;
prefix_ = x.prefix_;
bound_=x.bound_;
- style_=x.style_;
- cur_arg_=x.cur_arg_;
+ style_=x.style_;
+ cur_arg_=x.cur_arg_;
num_args_=x.num_args_;
dumped_=x.dumped_;
return *this;
template< class Ch, class Tr>
-unsigned char basic_format<Ch,Tr> ::exceptions() const
+unsigned char basic_format<Ch,Tr> ::exceptions() const
{
- return exceptions_;
+ return exceptions_;
}
template< class Ch, class Tr>
-unsigned char basic_format<Ch,Tr> ::exceptions(unsigned char newexcept)
-{
- unsigned char swp = exceptions_;
- exceptions_ = newexcept;
- return swp;
+unsigned char basic_format<Ch,Tr> ::exceptions(unsigned char newexcept)
+{
+ unsigned char swp = exceptions_;
+ exceptions_ = newexcept;
+ return swp;
}
}
template< class Ch, class Tr>
-basic_format<Ch,Tr>& basic_format<Ch,Tr> ::clear_binds()
+basic_format<Ch,Tr>& basic_format<Ch,Tr> ::clear_binds()
// cancel all bindings, and clear()
{
bound_.resize(0);
}
template< class Ch, class Tr>
-basic_format<Ch,Tr>& basic_format<Ch,Tr> ::clear_bind(int argN)
+basic_format<Ch,Tr>& basic_format<Ch,Tr> ::clear_bind(int argN)
// cancel the binding of ONE argument, and clear()
{
- if(argN<1 || argN > num_args_ || bound_.size()==0 || !bound_[argN-1] )
+ if(argN<1 || argN > num_args_ || bound_.size()==0 || !bound_[argN-1] )
{
if( exceptions() & io::out_of_range_bit )
boost::throw_exception(io::out_of_range()); // arg not in range.
unsigned long sz = prefix_.size();
unsigned long i;
- for(i=0; i < items_.size(); ++i)
+ for(i=0; i < items_.size(); ++i)
sz += items_[i].res_.size() + items_[i].appendix_.size();
string_t res;
res.reserve(sz);
res += prefix_;
- for(i=0; i < items_.size(); ++i)
+ for(i=0; i < items_.size(); ++i)
{
const format_item_t& item = items_[i];
res += item.res_;
- if( item.argN_ == format_item_t::argN_tabulation)
- {
+ if( item.argN_ == format_item_t::argN_tabulation)
+ {
BOOST_ASSERT( item.pad_scheme_ & format_item_t::tabulation);
std::streamsize n = item.state_.width_ - res.size();
if( n > 0 )
namespace io {
namespace detail {
-template<class Ch, class Tr, class T>
-basic_format<Ch, Tr>& bind_arg_body( basic_format<Ch, Tr>& self,
- int argN,
+template<class Ch, class Tr, class T>
+basic_format<Ch, Tr>& bind_arg_body( basic_format<Ch, Tr>& self,
+ int argN,
const T& val)
// bind one argument to a fixed value
// this is persistent over clear() calls, thus also over str() and <<
{
if(self.dumped_) self.clear(); // needed, because we will modify cur_arg_..
- if(argN<1 || argN > self.num_args_)
+ if(argN<1 || argN > self.num_args_)
{
if( self.exceptions() & io::out_of_range_bit )
boost::throw_exception(io::out_of_range()); // arg not in range.
else return self;
}
- if(self.bound_.size()==0)
+ if(self.bound_.size()==0)
self.bound_.assign(self.num_args_,false);
- else
+ else
BOOST_ASSERT( self.num_args_ == static_cast<signed int>(self.bound_.size()) );
int o_cur_arg = self.cur_arg_;
self.cur_arg_ = argN-1; // arrays begin at 0
self.bound_[self.cur_arg_]=false; // if already set, we unset and re-sets..
self.operator%(val); // put val at the right place, because cur_arg is set
-
+
// Now re-position cur_arg before leaving :
- self.cur_arg_ = o_cur_arg;
+ self.cur_arg_ = o_cur_arg;
self.bound_[argN-1]=true;
if(self.cur_arg_ == argN-1 )
// hum, now this arg is bound, so move to next free arg
return self;
}
-template<class Ch, class Tr, class T>
+template<class Ch, class Tr, class T>
basic_format<Ch, Tr>& modify_item_body( basic_format<Ch, Tr>& self,
- int itemN,
+ int itemN,
const T& manipulator)
// applies a manipulator to the format_item describing a given directive.
// this is a permanent change, clear or clear_binds won't cancel that.
{
- if(itemN<1 || itemN >= static_cast<signed int>(self.items_.size() ))
+ if(itemN<1 || itemN >= static_cast<signed int>(self.items_.size() ))
{
- if( self.exceptions() & io::out_of_range_bit )
+ if( self.exceptions() & io::out_of_range_bit )
boost::throw_exception(io::out_of_range()); // item not in range.
else return self;
}
namespace detail {
template<class Ch, class Stream> inline
- bool wrap_isdigit(Ch c, Stream &os)
+ bool wrap_isdigit(Ch c, Stream &os)
{
#ifndef BOOST_NO_LOCALE_ISIDIGIT
return std::isdigit(c, os.rdbuf()->getloc() );
# else
using namespace std;
- return isdigit(c);
-#endif
+ return isdigit(c);
+#endif
} //end- wrap_isdigit(..)
template<class Res, class Ch, class Tr> inline
- Res str2int(const std::basic_string<Ch, Tr>& s,
- typename std::basic_string<Ch, Tr>::size_type start,
+ Res str2int(const std::basic_string<Ch, Tr>& s,
+ typename std::basic_string<Ch, Tr>::size_type start,
BOOST_IO_STD basic_ios<Ch,Tr> &os,
- const Res = Res(0) )
+ const Res = Res(0) )
// Input : char string, with starting index
// a basic_ios& merely to call its widen/narrow member function in the desired locale.
// Effects : reads s[start:] and converts digits into an integral n, of type Res
}
template<class Ch, class Tr>
- void skip_asterisk(const std::basic_string<Ch,Tr> & buf,
+ void skip_asterisk(const std::basic_string<Ch,Tr> & buf,
typename std::basic_string<Ch,Tr>::size_type * pos_p,
BOOST_IO_STD basic_ios<Ch, Tr> &os)
// skip printf's "asterisk-fields" directives in the format-string buf
if(exceptions & io::bad_format_string_bit)
boost::throw_exception(io::bad_format_string());
}
-
+
template<class Ch, class Tr>
// Input : a 'printf-directive' in the format-string, starting at buf[ *pos_p ]
// a basic_ios& merely to call its widen/narrow member function in the desired locale.
// a bitset'excpetions' telling whether to throw exceptions on errors.
- // Returns : true if parse somehow succeeded (possibly ignoring errors if exceptions disabled)
+ // Returns : true if parse somehow succeeded (possibly ignoring errors if exceptions disabled)
// false if it failed so bad that the directive should be printed verbatim
// Effects : - *pos_p is incremented so that buf[*pos_p] is the first char after the directive
// - *fpar is set with the parameters read in the directive
{
typedef format_item<Ch, Tr> format_item_t;
BOOST_ASSERT( pos_p != 0);
- typename std::basic_string<Ch, Tr>::size_type &i1 = *pos_p,
- i0;
+ typename std::basic_string<Ch, Tr>::size_type &i1 = *pos_p,
+ i0;
fpar->argN_ = format_item_t::argN_no_posit; // if no positional-directive
bool in_brackets=false;
}
// the flag '0' would be picked as a digit for argument order, but here it's a flag :
- if(buf[i1]==os.widen('0'))
+ if(buf[i1]==os.widen('0'))
goto parse_flags;
// handle argument order (%2$d) or possibly width specification: %2d
i0 = i1; // save position before digits
while (i1 < buf.size() && wrap_isdigit(buf[i1], os))
++i1;
- if (i1!=i0)
+ if (i1!=i0)
{
if( i1 >= buf.size() ) {
maybe_throw_exception(exceptions);
return false;
}
int n=str2int(buf,i0, os, int(0) );
-
+
// %N% case : this is already the end of the directive
- if( buf[i1] == os.widen('%') )
+ if( buf[i1] == os.widen('%') )
{
fpar->argN_ = n-1;
++i1;
- if( in_brackets)
- maybe_throw_exception(exceptions);
+ if( in_brackets)
+ maybe_throw_exception(exceptions);
// but don't return. maybe "%" was used in lieu of '$', so we go on.
else return true;
}
- if ( buf[i1]==os.widen('$') )
+ if ( buf[i1]==os.widen('$') )
{
fpar->argN_ = n-1;
++i1;
- }
- else
+ }
+ else
{
// non-positionnal directive
fpar->ref_state_.width_ = n;
goto parse_precision;
}
}
-
- parse_flags:
+
+ parse_flags:
// handle flags
while ( i1 <buf.size()) // as long as char is one of + - = # 0 l h or ' '
- {
+ {
// misc switches
- switch (os.narrow(buf[i1], 0))
+ switch (os.narrow(buf[i1], 0))
{
case '\'' : break; // no effect yet. (painful to implement)
case 'l':
fpar->ref_state_.flags_ |= std::ios_base::showpos;
break;
case '0':
- fpar->pad_scheme_ |= format_item_t::zeropad;
+ fpar->pad_scheme_ |= format_item_t::zeropad;
// need to know alignment before really setting flags,
// so just add 'zeropad' flag for now, it will be processed later.
break;
} // loop on flag.
if( i1>=buf.size()) {
maybe_throw_exception(exceptions);
- return true;
+ return true;
}
parse_width:
i0 = i1; // save position before digits
while (i1<buf.size() && wrap_isdigit(buf[i1], os))
i1++;
-
- if (i1!=i0)
+
+ if (i1!=i0)
{ fpar->ref_state_.width_ = str2int( buf,i0, os, std::streamsize(0) ); }
parse_precision:
- if( i1>=buf.size()) {
+ if( i1>=buf.size()) {
maybe_throw_exception(exceptions);
return true;
}
// handle precision spec
- if (buf[i1]==os.widen('.'))
+ if (buf[i1]==os.widen('.'))
{
++i1;
skip_asterisk(buf, &i1, os);
if(i1==i0)
fpar->ref_state_.precision_ = 0;
- else
+ else
fpar->ref_state_.precision_ = str2int(buf,i0, os, std::streamsize(0) );
}
-
+
// handle formatting-type flags :
- while( i1<buf.size() &&
+ while( i1<buf.size() &&
( buf[i1]==os.widen('l') || buf[i1]==os.widen('L') || buf[i1]==os.widen('h')) )
++i1;
if( i1>=buf.size()) {
maybe_throw_exception(exceptions);
return true;
}
-
- if( in_brackets && buf[i1]==os.widen('|') )
+
+ if( in_brackets && buf[i1]==os.widen('|') )
{
++i1;
return true;
}
- switch (os.narrow(buf[i1], 0) )
+ switch (os.narrow(buf[i1], 0) )
{
case 'X':
fpar->ref_state_.flags_ |= std::ios_base::uppercase;
fpar->ref_state_.flags_ &= ~std::ios_base::basefield;
fpar->ref_state_.flags_ |= std::ios_base::hex;
break;
-
+
case 'o':
fpar->ref_state_.flags_ &= ~std::ios_base::basefield;
fpar->ref_state_.flags_ |= std::ios_base::oct;
fpar->ref_state_.flags_ &= ~std::ios_base::basefield;
fpar->ref_state_.flags_ |= std::ios_base::dec;
break;
-
+
case 'f':
fpar->ref_state_.flags_ &= ~std::ios_base::floatfield;
fpar->ref_state_.flags_ |= std::ios_base::fixed;
else
fpar->ref_state_.fill_ = buf[i1];
fpar->pad_scheme_ |= format_item_t::tabulation;
- fpar->argN_ = format_item_t::argN_tabulation;
+ fpar->argN_ = format_item_t::argN_tabulation;
break;
- case 't':
+ case 't':
fpar->ref_state_.fill_ = os.widen(' ');
fpar->pad_scheme_ |= format_item_t::tabulation;
- fpar->argN_ = format_item_t::argN_tabulation;
+ fpar->argN_ = format_item_t::argN_tabulation;
break;
case 'G':
fpar->ref_state_.flags_ |= std::ios_base::dec;
// CLEAR all floatield flags, so stream will CHOOSE
- fpar->ref_state_.flags_ &= ~std::ios_base::floatfield;
+ fpar->ref_state_.flags_ &= ~std::ios_base::floatfield;
break;
case 'C':
- case 'c':
+ case 'c':
fpar->truncate_ = 1;
break;
case 'S':
- case 's':
+ case 's':
fpar->truncate_ = fpar->ref_state_.precision_;
fpar->ref_state_.precision_ = -1;
break;
- case 'n' :
+ case 'n' :
fpar->argN_ = format_item_t::argN_ignored;
break;
- default:
+ default:
maybe_throw_exception(exceptions);
}
++i1;
if( in_brackets )
{
- if( i1<buf.size() && buf[i1]==os.widen('|') )
+ if( i1<buf.size() && buf[i1]==os.widen('|') )
{
++i1;
return true;
// format :: parse(..)
template<class Ch, class Traits>
-void basic_format<Ch, Traits> ::parse(const string_t & buf)
+void basic_format<Ch, Traits> ::parse(const string_t & buf)
// parse the format-string
{
using namespace std;
const Ch arg_mark = oss_.widen('%');
- bool ordered_args=true;
+ bool ordered_args=true;
int max_argN=-1;
typename string_t::size_type i1=0;
int num_items=0;
-
+
// A: find upper_bound on num_items and allocates arrays
- i1=0;
- while( (i1=buf.find(arg_mark,i1)) != string_t::npos )
+ i1=0;
+ while( (i1=buf.find(arg_mark,i1)) != string_t::npos )
{
if( i1+1 >= buf.size() ) {
if(exceptions() & io::bad_format_string_bit)
}
if(buf[i1+1] == buf[i1] ) { i1+=2; continue; } // escaped "%%" / "##"
++i1;
-
+
// in case of %N% directives, dont count it double (wastes allocations..) :
while(i1 < buf.size() && io::detail::wrap_isdigit(buf[i1],oss_)) ++i1;
if( i1 < buf.size() && buf[i1] == arg_mark ) ++ i1;
++num_items;
}
items_.assign( num_items, format_item_t() );
-
+
// B: Now the real parsing of the format string :
num_items=0;
i1 = 0;
typename string_t::size_type i0 = i1;
bool special_things=false;
int cur_it=0;
- while( (i1=buf.find(arg_mark,i1)) != string_t::npos )
+ while( (i1=buf.find(arg_mark,i1)) != string_t::npos )
{
string_t & piece = (cur_it==0) ? prefix_ : items_[cur_it-1].appendix_;
if( buf[i1+1] == buf[i1] ) // escaped mark, '%%'
{
- piece += buf.substr(i0, i1-i0) + buf[i1];
+ piece += buf.substr(i0, i1-i0) + buf[i1];
i1+=2; i0=i1;
- continue;
+ continue;
}
BOOST_ASSERT( static_cast<unsigned int>(cur_it) < items_.size() || cur_it==0);
if(i1!=i0) piece += buf.substr(i0, i1-i0);
++i1;
-
+
bool parse_ok;
parse_ok = io::detail::parse_printf_directive(buf, &i1, &items_[cur_it], oss_, exceptions());
if( ! parse_ok ) continue; // the directive will be printed verbatim
++cur_it;
} // loop on %'s
BOOST_ASSERT(cur_it == num_items);
-
+
// store the final piece of string
string_t & piece = (cur_it==0) ? prefix_ : items_[cur_it-1].appendix_;
piece += buf.substr(i0);
-
- if( !ordered_args)
+
+ if( !ordered_args)
{
if(max_argN >= 0 ) // dont mix positional with non-positionnal directives
{
// set things like it would have been with positional directives :
int non_ordered_items = 0;
for(int i=0; i< num_items; ++i)
- if(items_[i].argN_ == format_item_t::argN_no_posit)
+ if(items_[i].argN_ == format_item_t::argN_no_posit)
{
items_[i].argN_ = non_ordered_items;
++non_ordered_items;
}
max_argN = non_ordered_items-1;
}
-
+
// C: set some member data :
items_.resize(num_items);
#endif
// Borland C++ 5.6.0 doesn't support enable_if
-#if BOOST_WORKAROUND(__BORLANDC__, <= 0x562)
+#if BOOST_WORKAROUND(__BORLANDC__, <= 0x564)
# define BOOST_FUNCTION_NO_ENABLE_IF
#endif
void operator==(const function_base&, const function_base&);
void operator!=(const function_base&, const function_base&);
-#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
inline bool operator==(const function_base& f,
detail::function::useless_clear_type*)
{
// See http://www.boost.org/libs/smart_ptr/intrusive_ptr.html for documentation.
//
+#include <boost/config.hpp>
+
#ifdef BOOST_MSVC // moved here to work around VC++ compiler crash
# pragma warning(push)
# pragma warning(disable:4284) // odd return type for operator->
return p_;
}
+#if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530)
+
+ operator bool () const
+ {
+ return p_ != 0;
+ }
+
+#else
+
typedef T * (intrusive_ptr::*unspecified_bool_type) () const;
operator unspecified_bool_type () const
return p_ == 0? 0: &intrusive_ptr::get;
}
+#endif
+
// operator! is a Borland-specific workaround
bool operator! () const
{
#else
-# if BOOST_WORKAROUND(BOOST_MSVC, <= 1200 && __SGI_STL_PORT)
+# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, <= 1200 && __SGI_STL_PORT)
// MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL
using std::basic_ostream;
template<class E, class T, class Y> basic_ostream<E, T> & operator<< (basic_ostream<E, T> & os, intrusive_ptr<Y> const & p)
#include <typeinfo>
#include <boost/config.hpp>
#include <boost/limits.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/type_traits/is_pointer.hpp>
#ifdef BOOST_NO_STRINGSTREAM
#if defined(BOOST_NO_STRINGSTREAM) || \
defined(BOOST_NO_STD_WSTRING) || \
defined(BOOST_NO_STD_LOCALE) || \
- defined(BOOST_NO_CWCHAR) || \
- defined(BOOST_MSVC) && (BOOST_MSVC <= 1200)
+ defined(BOOST_NO_INTRINSIC_WCHAR_T)
#define DISABLE_WIDE_CHAR_SUPPORT
#endif
-#ifdef BOOST_NO_INTRINSIC_WCHAR_T
-#include <cwchar>
-#endif
-
namespace boost
{
// exception used to indicate runtime lexical_cast failure
class bad_lexical_cast : public std::bad_cast
{
public:
+ bad_lexical_cast() :
+ source(&typeid(void)), target(&typeid(void))
+ {
+ }
+ bad_lexical_cast(
+ const std::type_info &s,
+ const std::type_info &t) :
+ source(&s), target(&t)
+ {
+ }
+ const std::type_info &source_type() const
+ {
+ return *source;
+ }
+ const std::type_info &target_type() const
+ {
+ return *target;
+ }
+ virtual const char *what() const throw()
+ {
+ return "bad lexical cast: "
+ "source type value could not be interpreted as target";
+ }
virtual ~bad_lexical_cast() throw()
{
}
+ private:
+ const std::type_info *source;
+ const std::type_info *target;
};
- namespace detail // actual underlying concrete exception type
- {
- template<typename Target, typename Source>
- class no_lexical_conversion : public bad_lexical_cast
- {
- public:
- no_lexical_conversion()
- : description(
- std::string() + "bad lexical cast: " +
- "source type value could not be interpreted as target, Target=" +
- typeid(Target).name() + ", Source=" + typeid(Source).name())
- {
- }
- virtual ~no_lexical_conversion() throw()
- {
- }
- virtual const char *what() const throw()
- {
- return description.c_str();
- }
- private:
- const std::string description; // static initialization fails on MSVC6
- };
- }
-
namespace detail // selectors for choosing stream character type
{
template<typename Type>
}
bool operator<<(const Source &input)
{
- return stream << input;
+ return !(stream << input).fail();
}
template<typename InputStreamable>
bool operator>>(InputStreamable &output)
Target result;
if(!(interpreter << arg && interpreter >> result))
- throw detail::no_lexical_conversion<Target, Source>();
+ throw_exception(bad_lexical_cast(typeid(Target), typeid(Source)));
return result;
}
}
#undef DISABLE_WIDE_CHAR_SUPPORT
#endif
+
+++ /dev/null
-//-----------------------------------------------------------------------------
-// boost mpl/size_t_c.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2000-02
-// Aleksey Gurtovoy
-//
-// 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 appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
-// without express or implied warranty.
-
-#ifndef BOOST_MPL_SIZE_T_C_HPP_INCLUDED
-#define BOOST_MPL_SIZE_T_C_HPP_INCLUDED
-
-#include "boost/mpl/integral_c.hpp"
-#include "boost/config.hpp"
-#include <cstddef> // for std::size_t
-
-namespace boost {
-namespace mpl {
-
-template< std::size_t N > struct size_t_c
-#if !defined(__BORLANDC__)
- : integral_c< std::size_t,N >
-{
- typedef size_t_c type;
-};
-#else
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = N);
- typedef size_t_c type;
- typedef std::size_t value_type;
-
- typedef size_t_c<N + 1> next;
- typedef size_t_c<N - 1> prior;
-
- operator std::size_t() const { return this->value; }
-};
-#endif
-
-} // namespace mpl
-} // namespace boost
-
-#endif // BOOST_MPL_SIZE_T_C_HPP_INCLUDED
+++ /dev/null
-// (C) Copyright Toon Knapen 2001. 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.
-//
-
-// See http://www.boost.org/libs/utility/permutation_iterator.htm for documentation.
-
-#ifndef boost_permutation_iterator_hpp
-#define boost_permutation_iterator_hpp
-
-#include <boost/iterator_adaptors.hpp>
-
-namespace boost {
-
- template < typename IndexIterator >
- struct permutation_iterator_policies : public default_iterator_policies
- {
- permutation_iterator_policies() {}
-
- permutation_iterator_policies(IndexIterator order_it)
- : order_it_( order_it )
- {}
-
- template <class IteratorAdaptor>
- typename IteratorAdaptor::reference dereference(const IteratorAdaptor& x) const
- { return *(x.base() + *order_it_); }
-
- template <class IteratorAdaptor>
- void increment(IteratorAdaptor&)
- { ++order_it_; }
-
- template <class IteratorAdaptor>
- void decrement(IteratorAdaptor&)
- { --order_it_; }
-
- template <class IteratorAdaptor, class DifferenceType>
- void advance(IteratorAdaptor& x, DifferenceType n)
- { std::advance( order_it_, n ); }
-
- template <class IteratorAdaptor1, class IteratorAdaptor2>
- typename IteratorAdaptor1::difference_type
- distance(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
- { return std::distance( x.policies().order_it_, y.policies().order_it_ ); }
-
- template <class IteratorAdaptor1, class IteratorAdaptor2>
- bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
- { return x.policies().order_it_ == y.policies().order_it_; }
-
- IndexIterator order_it_;
- };
-
- template < typename ElementIterator, typename IndexIterator >
- struct permutation_iterator_generator
- {
- typedef boost::iterator_adaptor
- < ElementIterator,
- permutation_iterator_policies< IndexIterator >
- > type;
- };
-
- template < class IndexIterator, class ElementIterator >
- inline typename permutation_iterator_generator< ElementIterator, IndexIterator >::type
- make_permutation_iterator(ElementIterator base, IndexIterator order)
- {
- typedef typename permutation_iterator_generator< ElementIterator, IndexIterator >::type result_t;
- return result_t( base, order );
- }
-
-} // namespace boost
-
-#endif // boost_permutation_iterator_hpp
-
#include <boost/assert.hpp>
#include <boost/checked_delete.hpp>
#include <boost/config.hpp> // in case ptrdiff_t not in std
+
+#include <boost/detail/workaround.hpp>
+
#include <cstddef> // for std::ptrdiff_t
namespace boost
// implicit conversion to "bool"
+#if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530)
+
+ operator bool () const
+ {
+ return ptr != 0;
+ }
+
+#else
+
typedef T * (this_type::*unspecified_bool_type)() const;
operator unspecified_bool_type() const // never throws
return ptr == 0? 0: &this_type::get;
}
+#endif
+
bool operator! () const // never throws
{
return ptr == 0;
#include <boost/assert.hpp>
#include <boost/checked_delete.hpp>
+#include <boost/detail/workaround.hpp>
#ifndef BOOST_NO_AUTO_PTR
# include <memory> // for std::auto_ptr
// implicit conversion to "bool"
+#if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530)
+
+ operator bool () const
+ {
+ return ptr != 0;
+ }
+
+#else
+
typedef T * (this_type::*unspecified_bool_type)() const;
operator unspecified_bool_type() const // never throws
return ptr == 0? 0: &this_type::get;
}
+#endif
+
bool operator! () const // never throws
{
return ptr == 0;
#include <boost/checked_delete.hpp>
#include <boost/detail/shared_count.hpp>
+#include <boost/detail/workaround.hpp>
#include <cstddef> // for std::ptrdiff_t
#include <algorithm> // for std::swap
// implicit conversion to "bool"
+#if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530)
+
+ operator bool () const
+ {
+ return px != 0;
+ }
+
+#else
+
typedef T * (this_type::*unspecified_bool_type)() const;
operator unspecified_bool_type() const // never throws
return px == 0? 0: &this_type::get;
}
+#endif
+
bool operator! () const // never throws
{
return px == 0;
// implicit conversion to "bool"
+#if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530)
+
+ operator bool () const
+ {
+ return px != 0;
+ }
+
+#else
+
typedef T * (this_type::*unspecified_bool_type)() const;
operator unspecified_bool_type() const // never throws
return px == 0? 0: &this_type::get;
}
+#endif
+
// operator! is redundant, but some compilers need it
bool operator! () const // never throws
#else
-# if BOOST_WORKAROUND(BOOST_MSVC, <= 1200 && __SGI_STL_PORT)
+# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, <= 1200 && __SGI_STL_PORT)
// MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL
using std::basic_ostream;
template<class E, class T, class Y> basic_ostream<E, T> & operator<< (basic_ostream<E, T> & os, shared_ptr<Y> const & p)
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) \
&& !BOOST_WORKAROUND(__SUNPRO_CC , BOOST_TESTED_AT(0x540)) \
- && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
// The EDG version number is a lower estimate.
// It is not currently known which EDG version
// exactly fixes the problem.
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
+ * about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
-
+
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE c_regex_traits.cpp
if(std::isxdigit(i))
class_map[i] |= char_class_xdigit;
}
- class_map[(unsigned char)('_')] |= char_class_underscore;
- class_map[(unsigned char)(' ')] |= char_class_blank;
- class_map[(unsigned char)('\t')] |= char_class_blank;
+ class_map[(unsigned char)'_'] |= char_class_underscore;
+ class_map[(unsigned char)' '] |= char_class_blank;
+ class_map[(unsigned char)'\t'] |= char_class_blank;
for(i = 0; i < map_size; ++i)
{
lower_case_map[i] = (char)std::tolower(i);
#endif // BOOST_NO_WREGEX
} // namespace boost
+
+
+
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
+ * about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
-
+
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE: c_regex_traits.cpp
#else
BOOST_REGEX_NOEH_ASSERT(cat >= 0);
#endif
- }
+ }
#endif
std::memset(syntax_map, cpp_regex_traits<char>::syntax_char, 256);
unsigned i;
if((int)cat >= 0)
msgs.close(cat);
-#endif
+#endif
}
} // namespace re_detail
} // namespace boost
#endif
+
+
#endif
#define BOOST_DISABLE_THREADS 1
-#define BOOST_NO_EXCEPTIONS 1
#define BOOST_NO_WREGEX 1
#define BOOST_NO_WSTRING 1