Commit e9599233 by Benjamin Kosnik Committed by Benjamin Kosnik

Makefile.am: Add functional.cc, shared_ptr.cc.



2011-03-14  Benjamin Kosnik  <bkoz@redhat.com>

	* src/Makefile.am: Add functional.cc, shared_ptr.cc.
	* src/Makefile.in: Regenerate.
	* libsupc++/Makefile.am: Add nested_exception.cc.
	* libsupc++/Makefile.in: Regenerate.
	* src/system_error.cc: Add ctor and dtor definitions for error_category.
	* src/functional.cc: New. Add dtor definition for bad_function_call.
	* src/stdexcept.cc: Add dtor definitions for domain_error,
	invalid_argument, length_error, out_of_range, range_error,
	overflow_error, underflow_error.
	* src/future.cc: Add dtor definition for __future_base::_Result_base.
	* src/shared_ptr.cc: New. Add dtor definition for bad_weak_ptr.
	* src/thread.cc: Add dtor for thread::_Impl_base.
	* include/std/system_error: Adjust.
	* include/std/stdexcept: Same.
	* include/std/future: Same.
	* include/std/functional: Same.
	* include/std/thread: Same.
	* include/bits/shared_ptr_base.h: Same.
	* libsupc++/nested_exception.cc: New. Add dtor for nested_exception.
	* libsupc++/nested_exception.h: Adjust.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
	* config/abi/pre/gnu.ver: Add new exports.

	* include/bits/regex_compiler.h: Nest namespace versioning.
	* include/bits/regex_grep_matcher.tcc: Same.
	* include/bits/regex_grep_matcher.h: Same.
	* include/bits/regex_cursor.h: Same.
	* include/bits/regex_nfa.h: Same.
	* include/bits/regex_nfa.tcc: Same.

From-SVN: r170975
parent fe8e6abc
2011-03-14 Benjamin Kosnik <bkoz@redhat.com>
* src/Makefile.am: Add functional.cc, shared_ptr.cc.
* src/Makefile.in: Regenerate.
* libsupc++/Makefile.am: Add nested_exception.cc.
* libsupc++/Makefile.in: Regenerate.
* src/system_error.cc: Add ctor and dtor definitions for error_category.
* src/functional.cc: New. Add dtor definition for bad_function_call.
* src/stdexcept.cc: Add dtor definitions for domain_error,
invalid_argument, length_error, out_of_range, range_error,
overflow_error, underflow_error.
* src/future.cc: Add dtor definition for __future_base::_Result_base.
* src/shared_ptr.cc: New. Add dtor definition for bad_weak_ptr.
* src/thread.cc: Add dtor for thread::_Impl_base.
* include/std/system_error: Adjust.
* include/std/stdexcept: Same.
* include/std/future: Same.
* include/std/functional: Same.
* include/std/thread: Same.
* include/bits/shared_ptr_base.h: Same.
* libsupc++/nested_exception.cc: New. Add dtor for nested_exception.
* libsupc++/nested_exception.h: Adjust.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* config/abi/pre/gnu.ver: Add new exports.
* include/bits/regex_compiler.h: Nest namespace versioning.
* include/bits/regex_grep_matcher.tcc: Same.
* include/bits/regex_grep_matcher.h: Same.
* include/bits/regex_cursor.h: Same.
* include/bits/regex_nfa.h: Same.
* include/bits/regex_nfa.tcc: Same.
2011-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2011-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* doc/xml/manual/abi.xml: Replace docs.sun.com URLs by their OTN * doc/xml/manual/abi.xml: Replace docs.sun.com URLs by their OTN
......
...@@ -124,7 +124,7 @@ GLIBCXX_3.4 { ...@@ -124,7 +124,7 @@ GLIBCXX_3.4 {
std::messages*; std::messages*;
std::money*; std::money*;
# std::n[^u]*; # std::n[^u]*;
std::n[^au]*; std::n[^aue]*;
std::nu[^m]*; std::nu[^m]*;
std::num[^e]*; std::num[^e]*;
std::ostrstream*; std::ostrstream*;
...@@ -1219,6 +1219,31 @@ GLIBCXX_3.4.15 { ...@@ -1219,6 +1219,31 @@ GLIBCXX_3.4.15 {
_ZTISt11regex_error; _ZTISt11regex_error;
_ZSt19__throw_regex_errorNSt15regex_constants10error_typeE; _ZSt19__throw_regex_errorNSt15regex_constants10error_typeE;
_ZNSt12bad_weak_ptrD*;
_ZNKSt12bad_weak_ptr4whatEv;
_ZTSSt12bad_weak_ptr;
_ZTVSt12bad_weak_ptr;
_ZTISt12bad_weak_ptr;
_ZNSt14error_categoryC*;
_ZNSt14error_categoryD*;
_ZNSt13__future_base12_Result_baseC*;
_ZNSt13__future_base12_Result_baseD*;
_ZTINSt13__future_base12_Result_baseE;
_ZTSNSt13__future_base12_Result_baseE;
_ZTVNSt13__future_base12_Result_baseE;
_ZNSt13__future_base11_State_baseD*;
_ZTINSt13__future_base11_State_baseE;
_ZTSNSt13__future_base11_State_baseE;
_ZTVNSt13__future_base11_State_baseE;
_ZNSt6thread10_Impl_baseD*;
_ZTINSt6thread10_Impl_baseE;
_ZTSNSt6thread10_Impl_baseE;
_ZTVNSt6thread10_Impl_baseE;
} GLIBCXX_3.4.14; } GLIBCXX_3.4.14;
# Symbols in the support library (libsupc++) have their own tag. # Symbols in the support library (libsupc++) have their own tag.
...@@ -1403,4 +1428,10 @@ CXXABI_1.3.5 { ...@@ -1403,4 +1428,10 @@ CXXABI_1.3.5 {
_ZTSSt17bad_function_call; _ZTSSt17bad_function_call;
_ZTVSt17bad_function_call; _ZTVSt17bad_function_call;
# std::nested_exception
_ZNSt16nested_exceptionD*;
_ZTISt16nested_exception;
_ZTSSt16nested_exception;
_ZTVSt16nested_exception;
} CXXABI_1.3.4; } CXXABI_1.3.4;
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace __regex namespace __regex
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
struct _Scanner_base struct _Scanner_base
{ {
typedef unsigned int _StateT; typedef unsigned int _StateT;
...@@ -41,6 +41,8 @@ namespace __regex ...@@ -41,6 +41,8 @@ namespace __regex
static constexpr _StateT _S_state_at_start = 1 << 0; static constexpr _StateT _S_state_at_start = 1 << 0;
static constexpr _StateT _S_state_in_brace = 1 << 2; static constexpr _StateT _S_state_in_brace = 1 << 2;
static constexpr _StateT _S_state_in_bracket = 1 << 3; static constexpr _StateT _S_state_in_bracket = 1 << 3;
virtual ~_Scanner_base() { };
}; };
// //
...@@ -1100,9 +1102,8 @@ namespace __regex ...@@ -1100,9 +1102,8 @@ namespace __regex
{ return _AutomatonPtr(new _Nfa(_Compiler<_InIter, _TraitsT>(__b, __e, __t, { return _AutomatonPtr(new _Nfa(_Compiler<_InIter, _TraitsT>(__b, __e, __t,
__f)._M_nfa())); } __f)._M_nfa())); }
} // namespace __regex
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace __regex
} // namespace std
/* vim: set ts=8 sw=2 sts=2: */ /* vim: set ts=8 sw=2 sts=2: */
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace __regex namespace __regex
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
// ABC for pattern matching // ABC for pattern matching
struct _PatternCursor struct _PatternCursor
{ {
...@@ -88,7 +88,6 @@ namespace __regex ...@@ -88,7 +88,6 @@ namespace __regex
__cursor(const _FwdIterT& __b, const _FwdIterT __e) __cursor(const _FwdIterT& __b, const _FwdIterT __e)
{ return _SpecializedCursor<_FwdIterT>(__b, __e); } { return _SpecializedCursor<_FwdIterT>(__b, __e); }
} // namespace __regex
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __regex
} // namespace } // namespace
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _BiIter> template<typename _BiIter>
class sub_match; class sub_match;
...@@ -40,6 +39,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -40,6 +39,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace __regex namespace __regex
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
// A _Results facade specialized for wrapping a templated match_results. // A _Results facade specialized for wrapping a templated match_results.
template<typename _FwdIterT, typename _Alloc> template<typename _FwdIterT, typename _Alloc>
class _SpecializedResults class _SpecializedResults
...@@ -121,9 +122,8 @@ namespace __regex ...@@ -121,9 +122,8 @@ namespace __regex
_Results& _M_results; _Results& _M_results;
}; };
} // namespace __regex
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __regex
} // namespace } // namespace
#include <bits/regex_grep_matcher.tcc> #include <bits/regex_grep_matcher.tcc>
...@@ -32,11 +32,8 @@ ...@@ -32,11 +32,8 @@
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace namespace
{ {
// A stack of states used in evaluating the NFA. // A stack of states used in evaluating the NFA.
typedef std::stack<std::__regex::_StateIdT, typedef std::stack<std::__regex::_StateIdT,
std::vector<std::__regex::_StateIdT> std::vector<std::__regex::_StateIdT>
...@@ -104,6 +101,8 @@ namespace ...@@ -104,6 +101,8 @@ namespace
namespace __regex namespace __regex
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
inline _Grep_matcher:: inline _Grep_matcher::
_Grep_matcher(_PatternCursor& __p, _Results& __r, _Grep_matcher(_PatternCursor& __p, _Results& __r,
const _AutomatonPtr& __nfa, const _AutomatonPtr& __nfa,
...@@ -175,7 +174,6 @@ namespace __regex ...@@ -175,7 +174,6 @@ namespace __regex
return __e; return __e;
} }
} // namespace __regex
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __regex
} // namespace } // namespace
...@@ -30,10 +30,9 @@ ...@@ -30,10 +30,9 @@
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace __regex namespace __regex
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Base class for, um, automata. Could be an NFA or a DFA. Your choice. // Base class for, um, automata. Could be an NFA or a DFA. Your choice.
class _Automaton class _Automaton
...@@ -43,8 +42,7 @@ namespace __regex ...@@ -43,8 +42,7 @@ namespace __regex
public: public:
virtual virtual
~_Automaton() ~_Automaton() { }
{ }
virtual _SizeT virtual _SizeT
_M_sub_count() const = 0; _M_sub_count() const = 0;
...@@ -394,10 +392,9 @@ namespace __regex ...@@ -394,10 +392,9 @@ namespace __regex
}; };
} // namespace __regex
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace __regex
} // namespace std
#include <bits/regex_nfa.tcc> #include <bits/regex_nfa.tcc>
// class template regex -*- C++ -*- // class template regex -*- C++ -*-
// Copyright (C) 2010 Free Software Foundation, Inc. // Copyright (C) 2010, 2011 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace __regex namespace __regex
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
#ifdef _GLIBCXX_DEBUG #ifdef _GLIBCXX_DEBUG
inline std::ostream& _State:: inline std::ostream& _State::
_M_print(std::ostream& ostr) const _M_print(std::ostream& ostr) const
...@@ -169,7 +169,6 @@ inline _StateIdT _StateSeq:: ...@@ -169,7 +169,6 @@ inline _StateIdT _StateSeq::
_M_clone() _M_clone()
{ return 0; } { return 0; }
} // namespace __regex
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __regex
} // namespace } // namespace
...@@ -61,8 +61,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -61,8 +61,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
public: public:
virtual char const* virtual char const*
what() const throw() what() const throw();
{ return "std::bad_weak_ptr"; }
virtual ~bad_weak_ptr() throw();
}; };
// Substitute for bad_weak_ptr object in the case of -fno-exceptions. // Substitute for bad_weak_ptr object in the case of -fno-exceptions.
......
...@@ -83,90 +83,90 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -83,90 +83,90 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
{ }; { };
/// Retrieve the result type for a function type. /// Retrieve the result type for a function type.
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res(_ArgTypes...)> struct _Weak_result_type_impl<_Res(_ArgTypes...)>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res(_ArgTypes......)> struct _Weak_result_type_impl<_Res(_ArgTypes......)>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res(_ArgTypes...) const> struct _Weak_result_type_impl<_Res(_ArgTypes...) const>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res(_ArgTypes......) const> struct _Weak_result_type_impl<_Res(_ArgTypes......) const>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res(_ArgTypes...) volatile> struct _Weak_result_type_impl<_Res(_ArgTypes...) volatile>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res(_ArgTypes......) volatile> struct _Weak_result_type_impl<_Res(_ArgTypes......) volatile>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res(_ArgTypes...) const volatile> struct _Weak_result_type_impl<_Res(_ArgTypes...) const volatile>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res(_ArgTypes......) const volatile> struct _Weak_result_type_impl<_Res(_ArgTypes......) const volatile>
{ typedef _Res result_type; }; { typedef _Res result_type; };
/// Retrieve the result type for a function reference. /// Retrieve the result type for a function reference.
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res(&)(_ArgTypes...)> struct _Weak_result_type_impl<_Res(&)(_ArgTypes...)>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res(&)(_ArgTypes......)> struct _Weak_result_type_impl<_Res(&)(_ArgTypes......)>
{ typedef _Res result_type; }; { typedef _Res result_type; };
/// Retrieve the result type for a function pointer. /// Retrieve the result type for a function pointer.
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res(*)(_ArgTypes...)> struct _Weak_result_type_impl<_Res(*)(_ArgTypes...)>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res(*)(_ArgTypes......)> struct _Weak_result_type_impl<_Res(*)(_ArgTypes......)>
{ typedef _Res result_type; }; { typedef _Res result_type; };
/// Retrieve result type for a member function pointer. /// Retrieve result type for a member function pointer.
template<typename _Res, typename _Class, typename... _ArgTypes> template<typename _Res, typename _Class, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...)> struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...)>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename _Class, typename... _ArgTypes> template<typename _Res, typename _Class, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......)> struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......)>
{ typedef _Res result_type; }; { typedef _Res result_type; };
/// Retrieve result type for a const member function pointer. /// Retrieve result type for a const member function pointer.
template<typename _Res, typename _Class, typename... _ArgTypes> template<typename _Res, typename _Class, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) const> struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) const>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename _Class, typename... _ArgTypes> template<typename _Res, typename _Class, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......) const> struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......) const>
{ typedef _Res result_type; }; { typedef _Res result_type; };
/// Retrieve result type for a volatile member function pointer. /// Retrieve result type for a volatile member function pointer.
template<typename _Res, typename _Class, typename... _ArgTypes> template<typename _Res, typename _Class, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) volatile> struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) volatile>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename _Class, typename... _ArgTypes> template<typename _Res, typename _Class, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......) volatile> struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......) volatile>
{ typedef _Res result_type; }; { typedef _Res result_type; };
/// Retrieve result type for a const volatile member function pointer. /// Retrieve result type for a const volatile member function pointer.
template<typename _Res, typename _Class, typename... _ArgTypes> template<typename _Res, typename _Class, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...)
const volatile> const volatile>
{ typedef _Res result_type; }; { typedef _Res result_type; };
template<typename _Res, typename _Class, typename... _ArgTypes> template<typename _Res, typename _Class, typename... _ArgTypes>
struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......) struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......)
const volatile> const volatile>
{ typedef _Res result_type; }; { typedef _Res result_type; };
...@@ -186,7 +186,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -186,7 +186,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
{ {
private: private:
template<typename _T1, typename _Res> template<typename _T1, typename _Res>
static __one __test(const volatile unary_function<_T1, _Res>*); static __one __test(const volatile unary_function<_T1, _Res>*);
// It's tempting to change "..." to const volatile void*, but // It's tempting to change "..." to const volatile void*, but
// that fails when _Tp is a function type. // that fails when _Tp is a function type.
...@@ -202,7 +202,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -202,7 +202,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
{ {
private: private:
template<typename _T1, typename _T2, typename _Res> template<typename _T1, typename _T2, typename _Res>
static __one __test(const volatile binary_function<_T1, _T2, _Res>*); static __one __test(const volatile binary_function<_T1, _T2, _Res>*);
// It's tempting to change "..." to const volatile void*, but // It's tempting to change "..." to const volatile void*, but
// that fails when _Tp is a function type. // that fails when _Tp is a function type.
...@@ -232,11 +232,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -232,11 +232,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
template<typename _Functor, typename... _Args> template<typename _Functor, typename... _Args>
inline inline
typename enable_if< typename enable_if<
(!is_member_pointer<_Functor>::value (!is_member_pointer<_Functor>::value
&& !is_function<_Functor>::value && !is_function<_Functor>::value
&& !is_function<typename remove_pointer<_Functor>::type>::value), && !is_function<typename remove_pointer<_Functor>::type>::value),
typename result_of<_Functor(_Args...)>::type typename result_of<_Functor(_Args...)>::type
>::type >::type
__invoke(_Functor& __f, _Args&&... __args) __invoke(_Functor& __f, _Args&&... __args)
{ {
return __f(std::forward<_Args>(__args)...); return __f(std::forward<_Args>(__args)...);
...@@ -246,10 +246,10 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -246,10 +246,10 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
template<typename _Functor, typename... _Args> template<typename _Functor, typename... _Args>
inline inline
typename enable_if< typename enable_if<
(is_pointer<_Functor>::value (is_pointer<_Functor>::value
&& is_function<typename remove_pointer<_Functor>::type>::value), && is_function<typename remove_pointer<_Functor>::type>::value),
typename result_of<_Functor(_Args...)>::type typename result_of<_Functor(_Args...)>::type
>::type >::type
__invoke(_Functor __f, _Args&&... __args) __invoke(_Functor __f, _Args&&... __args)
{ {
return __f(std::forward<_Args>(__args)...); return __f(std::forward<_Args>(__args)...);
...@@ -425,7 +425,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -425,7 +425,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// If _Tp is a function type, we can't form result_of<_Tp(...)>, // If _Tp is a function type, we can't form result_of<_Tp(...)>,
// so turn it into a function pointer type. // so turn it into a function pointer type.
typedef typename _Function_to_function_pointer<_Tp>::type typedef typename _Function_to_function_pointer<_Tp>::type
_M_func_type; _M_func_type;
_Tp* _M_data; _Tp* _M_data;
public: public:
...@@ -444,8 +444,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -444,8 +444,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
reference_wrapper& reference_wrapper&
operator=(const reference_wrapper<_Tp>& __inref) operator=(const reference_wrapper<_Tp>& __inref)
{ {
_M_data = __inref._M_data; _M_data = __inref._M_data;
return *this; return *this;
} }
operator _Tp&() const operator _Tp&() const
...@@ -456,9 +456,9 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -456,9 +456,9 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
{ return *_M_data; } { return *_M_data; }
template<typename... _Args> template<typename... _Args>
typename result_of<_M_func_type(_Args...)>::type typename result_of<_M_func_type(_Args...)>::type
operator()(_Args&&... __args) const operator()(_Args&&... __args) const
{ {
return __invoke(get(), std::forward<_Args>(__args)...); return __invoke(get(), std::forward<_Args>(__args)...);
} }
}; };
...@@ -498,16 +498,16 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -498,16 +498,16 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* nothing, depending on the number of arguments provided. The * nothing, depending on the number of arguments provided. The
* primary template is the basis case, which derives nothing. * primary template is the basis case, which derives nothing.
*/ */
template<typename _Res, typename... _ArgTypes> template<typename _Res, typename... _ArgTypes>
struct _Maybe_unary_or_binary_function { }; struct _Maybe_unary_or_binary_function { };
/// Derives from @c unary_function, as appropriate. /// Derives from @c unary_function, as appropriate.
template<typename _Res, typename _T1> template<typename _Res, typename _T1>
struct _Maybe_unary_or_binary_function<_Res, _T1> struct _Maybe_unary_or_binary_function<_Res, _T1>
: std::unary_function<_T1, _Res> { }; : std::unary_function<_T1, _Res> { };
/// Derives from @c binary_function, as appropriate. /// Derives from @c binary_function, as appropriate.
template<typename _Res, typename _T1, typename _T2> template<typename _Res, typename _T1, typename _T2>
struct _Maybe_unary_or_binary_function<_Res, _T1, _T2> struct _Maybe_unary_or_binary_function<_Res, _T1, _T2>
: std::binary_function<_T1, _T2, _Res> { }; : std::binary_function<_T1, _T2, _Res> { };
...@@ -519,15 +519,15 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -519,15 +519,15 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
typedef _Res (_Class::*_Functor)(_ArgTypes...); typedef _Res (_Class::*_Functor)(_ArgTypes...);
template<typename _Tp> template<typename _Tp>
_Res _Res
_M_call(_Tp& __object, const volatile _Class *, _M_call(_Tp& __object, const volatile _Class *,
_ArgTypes... __args) const _ArgTypes... __args) const
{ return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); } { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
template<typename _Tp> template<typename _Tp>
_Res _Res
_M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
{ return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); } { return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
public: public:
typedef _Res result_type; typedef _Res result_type;
...@@ -546,12 +546,12 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -546,12 +546,12 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// Handle smart pointers, references and pointers to derived // Handle smart pointers, references and pointers to derived
template<typename _Tp> template<typename _Tp>
_Res _Res
operator()(_Tp& __object, _ArgTypes... __args) const operator()(_Tp& __object, _ArgTypes... __args) const
{ {
return _M_call(__object, &__object, return _M_call(__object, &__object,
std::forward<_ArgTypes>(__args)...); std::forward<_ArgTypes>(__args)...);
} }
private: private:
_Functor __pmf; _Functor __pmf;
...@@ -560,21 +560,21 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -560,21 +560,21 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
/// Implementation of @c mem_fn for const member function pointers. /// Implementation of @c mem_fn for const member function pointers.
template<typename _Res, typename _Class, typename... _ArgTypes> template<typename _Res, typename _Class, typename... _ArgTypes>
class _Mem_fn<_Res (_Class::*)(_ArgTypes...) const> class _Mem_fn<_Res (_Class::*)(_ArgTypes...) const>
: public _Maybe_unary_or_binary_function<_Res, const _Class*, : public _Maybe_unary_or_binary_function<_Res, const _Class*,
_ArgTypes...> _ArgTypes...>
{ {
typedef _Res (_Class::*_Functor)(_ArgTypes...) const; typedef _Res (_Class::*_Functor)(_ArgTypes...) const;
template<typename _Tp> template<typename _Tp>
_Res _Res
_M_call(_Tp& __object, const volatile _Class *, _M_call(_Tp& __object, const volatile _Class *,
_ArgTypes... __args) const _ArgTypes... __args) const
{ return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); } { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
template<typename _Tp> template<typename _Tp>
_Res _Res
_M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
{ return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); } { return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
public: public:
typedef _Res result_type; typedef _Res result_type;
...@@ -593,11 +593,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -593,11 +593,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// Handle smart pointers, references and pointers to derived // Handle smart pointers, references and pointers to derived
template<typename _Tp> template<typename _Tp>
_Res operator()(_Tp& __object, _ArgTypes... __args) const _Res operator()(_Tp& __object, _ArgTypes... __args) const
{ {
return _M_call(__object, &__object, return _M_call(__object, &__object,
std::forward<_ArgTypes>(__args)...); std::forward<_ArgTypes>(__args)...);
} }
private: private:
_Functor __pmf; _Functor __pmf;
...@@ -606,21 +606,21 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -606,21 +606,21 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
/// Implementation of @c mem_fn for volatile member function pointers. /// Implementation of @c mem_fn for volatile member function pointers.
template<typename _Res, typename _Class, typename... _ArgTypes> template<typename _Res, typename _Class, typename... _ArgTypes>
class _Mem_fn<_Res (_Class::*)(_ArgTypes...) volatile> class _Mem_fn<_Res (_Class::*)(_ArgTypes...) volatile>
: public _Maybe_unary_or_binary_function<_Res, volatile _Class*, : public _Maybe_unary_or_binary_function<_Res, volatile _Class*,
_ArgTypes...> _ArgTypes...>
{ {
typedef _Res (_Class::*_Functor)(_ArgTypes...) volatile; typedef _Res (_Class::*_Functor)(_ArgTypes...) volatile;
template<typename _Tp> template<typename _Tp>
_Res _Res
_M_call(_Tp& __object, const volatile _Class *, _M_call(_Tp& __object, const volatile _Class *,
_ArgTypes... __args) const _ArgTypes... __args) const
{ return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); } { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
template<typename _Tp> template<typename _Tp>
_Res _Res
_M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
{ return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); } { return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
public: public:
typedef _Res result_type; typedef _Res result_type;
...@@ -639,12 +639,12 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -639,12 +639,12 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// Handle smart pointers, references and pointers to derived // Handle smart pointers, references and pointers to derived
template<typename _Tp> template<typename _Tp>
_Res _Res
operator()(_Tp& __object, _ArgTypes... __args) const operator()(_Tp& __object, _ArgTypes... __args) const
{ {
return _M_call(__object, &__object, return _M_call(__object, &__object,
std::forward<_ArgTypes>(__args)...); std::forward<_ArgTypes>(__args)...);
} }
private: private:
_Functor __pmf; _Functor __pmf;
...@@ -653,21 +653,21 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -653,21 +653,21 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
/// Implementation of @c mem_fn for const volatile member function pointers. /// Implementation of @c mem_fn for const volatile member function pointers.
template<typename _Res, typename _Class, typename... _ArgTypes> template<typename _Res, typename _Class, typename... _ArgTypes>
class _Mem_fn<_Res (_Class::*)(_ArgTypes...) const volatile> class _Mem_fn<_Res (_Class::*)(_ArgTypes...) const volatile>
: public _Maybe_unary_or_binary_function<_Res, const volatile _Class*, : public _Maybe_unary_or_binary_function<_Res, const volatile _Class*,
_ArgTypes...> _ArgTypes...>
{ {
typedef _Res (_Class::*_Functor)(_ArgTypes...) const volatile; typedef _Res (_Class::*_Functor)(_ArgTypes...) const volatile;
template<typename _Tp> template<typename _Tp>
_Res _Res
_M_call(_Tp& __object, const volatile _Class *, _M_call(_Tp& __object, const volatile _Class *,
_ArgTypes... __args) const _ArgTypes... __args) const
{ return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); } { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
template<typename _Tp> template<typename _Tp>
_Res _Res
_M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
{ return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); } { return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
public: public:
typedef _Res result_type; typedef _Res result_type;
...@@ -675,22 +675,22 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -675,22 +675,22 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { } explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
// Handle objects // Handle objects
_Res _Res
operator()(const volatile _Class& __object, _ArgTypes... __args) const operator()(const volatile _Class& __object, _ArgTypes... __args) const
{ return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); } { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
// Handle pointers // Handle pointers
_Res _Res
operator()(const volatile _Class* __object, _ArgTypes... __args) const operator()(const volatile _Class* __object, _ArgTypes... __args) const
{ return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); } { return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
// Handle smart pointers, references and pointers to derived // Handle smart pointers, references and pointers to derived
template<typename _Tp> template<typename _Tp>
_Res operator()(_Tp& __object, _ArgTypes... __args) const _Res operator()(_Tp& __object, _ArgTypes... __args) const
{ {
return _M_call(__object, &__object, return _M_call(__object, &__object,
std::forward<_ArgTypes>(__args)...); std::forward<_ArgTypes>(__args)...);
} }
private: private:
_Functor __pmf; _Functor __pmf;
...@@ -715,60 +715,60 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -715,60 +715,60 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// This bit of genius is due to Peter Dimov, improved slightly by // This bit of genius is due to Peter Dimov, improved slightly by
// Douglas Gregor. // Douglas Gregor.
template<typename _Tp> template<typename _Tp>
_Res& _Res&
_M_call(_Tp& __object, _Class *) const _M_call(_Tp& __object, _Class *) const
{ return __object.*__pm; } { return __object.*__pm; }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
_Res& _Res&
_M_call(_Tp& __object, _Up * const *) const _M_call(_Tp& __object, _Up * const *) const
{ return (*__object).*__pm; } { return (*__object).*__pm; }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
const _Res& const _Res&
_M_call(_Tp& __object, const _Up * const *) const _M_call(_Tp& __object, const _Up * const *) const
{ return (*__object).*__pm; } { return (*__object).*__pm; }
template<typename _Tp> template<typename _Tp>
const _Res& const _Res&
_M_call(_Tp& __object, const _Class *) const _M_call(_Tp& __object, const _Class *) const
{ return __object.*__pm; } { return __object.*__pm; }
template<typename _Tp> template<typename _Tp>
const _Res& const _Res&
_M_call(_Tp& __ptr, const volatile void*) const _M_call(_Tp& __ptr, const volatile void*) const
{ return (*__ptr).*__pm; } { return (*__ptr).*__pm; }
template<typename _Tp> static _Tp& __get_ref(); template<typename _Tp> static _Tp& __get_ref();
template<typename _Tp> template<typename _Tp>
static __sfinae_types::__one __check_const(_Tp&, _Class*); static __sfinae_types::__one __check_const(_Tp&, _Class*);
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
static __sfinae_types::__one __check_const(_Tp&, _Up * const *); static __sfinae_types::__one __check_const(_Tp&, _Up * const *);
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
static __sfinae_types::__two __check_const(_Tp&, const _Up * const *); static __sfinae_types::__two __check_const(_Tp&, const _Up * const *);
template<typename _Tp> template<typename _Tp>
static __sfinae_types::__two __check_const(_Tp&, const _Class*); static __sfinae_types::__two __check_const(_Tp&, const _Class*);
template<typename _Tp> template<typename _Tp>
static __sfinae_types::__two __check_const(_Tp&, const volatile void*); static __sfinae_types::__two __check_const(_Tp&, const volatile void*);
public: public:
template<typename _Tp> template<typename _Tp>
struct _Result_type struct _Result_type
: _Mem_fn_const_or_non<_Res, : _Mem_fn_const_or_non<_Res,
(sizeof(__sfinae_types::__two) (sizeof(__sfinae_types::__two)
== sizeof(__check_const<_Tp>(__get_ref<_Tp>(), (_Tp*)0)))> == sizeof(__check_const<_Tp>(__get_ref<_Tp>(), (_Tp*)0)))>
{ }; { };
template<typename _Signature> template<typename _Signature>
struct result; struct result;
template<typename _CVMem, typename _Tp> template<typename _CVMem, typename _Tp>
struct result<_CVMem(_Tp)> struct result<_CVMem(_Tp)>
: public _Result_type<_Tp> { }; : public _Result_type<_Tp> { };
template<typename _CVMem, typename _Tp> template<typename _CVMem, typename _Tp>
struct result<_CVMem(_Tp&)> struct result<_CVMem(_Tp&)>
: public _Result_type<_Tp> { }; : public _Result_type<_Tp> { };
explicit explicit
...@@ -794,9 +794,9 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -794,9 +794,9 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// Handle smart pointers and derived // Handle smart pointers and derived
template<typename _Tp> template<typename _Tp>
typename _Result_type<_Tp>::type typename _Result_type<_Tp>::type
operator()(_Tp& __unknown) const operator()(_Tp& __unknown) const
{ return _M_call(__unknown, &__unknown); } { return _M_call(__unknown, &__unknown); }
private: private:
_Res _Class::*__pm; _Res _Class::*__pm;
...@@ -847,7 +847,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -847,7 +847,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* simplify this with variadic templates, because we're introducing * simplify this with variadic templates, because we're introducing
* unique names for each. * unique names for each.
*/ */
namespace placeholders namespace placeholders
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
extern const _Placeholder<1> _1; extern const _Placeholder<1> _1;
...@@ -894,7 +894,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -894,7 +894,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
: public integral_constant<int, _Num> : public integral_constant<int, _Num>
{ }; { };
/** /**
* Used by _Safe_tuple_element to indicate that there is no tuple * Used by _Safe_tuple_element to indicate that there is no tuple
* element at this position. * element at this position.
*/ */
...@@ -926,8 +926,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -926,8 +926,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
*/ */
template<int __i, typename _Tuple> template<int __i, typename _Tuple>
struct _Safe_tuple_element struct _Safe_tuple_element
: _Safe_tuple_element_impl<__i, _Tuple, : _Safe_tuple_element_impl<__i, _Tuple,
(__i >= 0 && __i < tuple_size<_Tuple>::value)> (__i >= 0 && __i < tuple_size<_Tuple>::value)>
{ }; { };
/** /**
...@@ -942,8 +942,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -942,8 +942,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* rest of the arguments. * rest of the arguments.
*/ */
template<typename _Arg, template<typename _Arg,
bool _IsBindExp = is_bind_expression<_Arg>::value, bool _IsBindExp = is_bind_expression<_Arg>::value,
bool _IsPlaceholder = (is_placeholder<_Arg>::value > 0)> bool _IsPlaceholder = (is_placeholder<_Arg>::value > 0)>
class _Mu; class _Mu;
/** /**
...@@ -961,9 +961,9 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -961,9 +961,9 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* but not volatile-qualified. This might be a defect in the TR. * but not volatile-qualified. This might be a defect in the TR.
*/ */
template<typename _CVRef, typename _Tuple> template<typename _CVRef, typename _Tuple>
result_type result_type
operator()(_CVRef& __arg, _Tuple&) const volatile operator()(_CVRef& __arg, _Tuple&) const volatile
{ return __arg.get(); } { return __arg.get(); }
}; };
/** /**
...@@ -976,11 +976,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -976,11 +976,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
{ {
public: public:
template<typename _CVArg, typename... _Args> template<typename _CVArg, typename... _Args>
auto auto
operator()(_CVArg& __arg, operator()(_CVArg& __arg,
tuple<_Args...>& __tuple) const volatile tuple<_Args...>& __tuple) const volatile
-> decltype(__arg(declval<_Args>()...)) -> decltype(__arg(declval<_Args>()...))
{ {
// Construct an index tuple and forward to __call // Construct an index tuple and forward to __call
typedef typename _Build_index_tuple<sizeof...(_Args)>::__type typedef typename _Build_index_tuple<sizeof...(_Args)>::__type
_Indexes; _Indexes;
...@@ -989,13 +989,13 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -989,13 +989,13 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
private: private:
// Invokes the underlying function object __arg by unpacking all // Invokes the underlying function object __arg by unpacking all
// of the arguments in the tuple. // of the arguments in the tuple.
template<typename _CVArg, typename... _Args, int... _Indexes> template<typename _CVArg, typename... _Args, int... _Indexes>
auto auto
__call(_CVArg& __arg, tuple<_Args...>& __tuple, __call(_CVArg& __arg, tuple<_Args...>& __tuple,
const _Index_tuple<_Indexes...>&) const volatile const _Index_tuple<_Indexes...>&) const volatile
-> decltype(__arg(declval<_Args>()...)) -> decltype(__arg(declval<_Args>()...))
{ {
return __arg(std::forward<_Args>(get<_Indexes>(__tuple))...); return __arg(std::forward<_Args>(get<_Indexes>(__tuple))...);
} }
}; };
...@@ -1012,8 +1012,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1012,8 +1012,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
template<typename _Signature> class result; template<typename _Signature> class result;
template<typename _CVMu, typename _CVArg, typename _Tuple> template<typename _CVMu, typename _CVArg, typename _Tuple>
class result<_CVMu(_CVArg, _Tuple)> class result<_CVMu(_CVArg, _Tuple)>
{ {
// Add a reference, if it hasn't already been done for us. // Add a reference, if it hasn't already been done for us.
// This allows us to be a little bit sloppy in constructing // This allows us to be a little bit sloppy in constructing
// the tuple that we pass to result_of<...>. // the tuple that we pass to result_of<...>.
...@@ -1026,11 +1026,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1026,11 +1026,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
}; };
template<typename _Tuple> template<typename _Tuple>
typename result<_Mu(_Arg, _Tuple)>::type typename result<_Mu(_Arg, _Tuple)>::type
operator()(const volatile _Arg&, _Tuple& __tuple) const volatile operator()(const volatile _Arg&, _Tuple& __tuple) const volatile
{ {
return std::forward<typename result<_Mu(_Arg, _Tuple)>::type>( return std::forward<typename result<_Mu(_Arg, _Tuple)>::type>(
::std::get<(is_placeholder<_Arg>::value - 1)>(__tuple)); ::std::get<(is_placeholder<_Arg>::value - 1)>(__tuple));
} }
}; };
...@@ -1046,16 +1046,16 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1046,16 +1046,16 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
template<typename _Signature> struct result; template<typename _Signature> struct result;
template<typename _CVMu, typename _CVArg, typename _Tuple> template<typename _CVMu, typename _CVArg, typename _Tuple>
struct result<_CVMu(_CVArg, _Tuple)> struct result<_CVMu(_CVArg, _Tuple)>
{ {
typedef typename add_lvalue_reference<_CVArg>::type type; typedef typename add_lvalue_reference<_CVArg>::type type;
}; };
// Pick up the cv-qualifiers of the argument // Pick up the cv-qualifiers of the argument
template<typename _CVArg, typename _Tuple> template<typename _CVArg, typename _Tuple>
_CVArg&& _CVArg&&
operator()(_CVArg&& __arg, _Tuple&) const volatile operator()(_CVArg&& __arg, _Tuple&) const volatile
{ return std::forward<_CVArg>(__arg); } { return std::forward<_CVArg>(__arg); }
}; };
/** /**
...@@ -1086,7 +1086,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1086,7 +1086,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
struct _Maybe_wrap_member_pointer<_Tp _Class::*> struct _Maybe_wrap_member_pointer<_Tp _Class::*>
{ {
typedef _Mem_fn<_Tp _Class::*> type; typedef _Mem_fn<_Tp _Class::*> type;
static type static type
__do_wrap(_Tp _Class::* __pm) __do_wrap(_Tp _Class::* __pm)
{ return type(__pm); } { return type(__pm); }
...@@ -1126,59 +1126,59 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1126,59 +1126,59 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
{ {
typedef _Bind __self_type; typedef _Bind __self_type;
typedef typename _Build_index_tuple<sizeof...(_Bound_args)>::__type typedef typename _Build_index_tuple<sizeof...(_Bound_args)>::__type
_Bound_indexes; _Bound_indexes;
_Functor _M_f; _Functor _M_f;
tuple<_Bound_args...> _M_bound_args; tuple<_Bound_args...> _M_bound_args;
// Call unqualified // Call unqualified
template<typename _Result, typename... _Args, int... _Indexes> template<typename _Result, typename... _Args, int... _Indexes>
_Result _Result
__call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>)
{ {
return _M_f(_Mu<_Bound_args>() return _M_f(_Mu<_Bound_args>()
(get<_Indexes>(_M_bound_args), __args)...); (get<_Indexes>(_M_bound_args), __args)...);
} }
// Call as const // Call as const
template<typename _Result, typename... _Args, int... _Indexes> template<typename _Result, typename... _Args, int... _Indexes>
_Result _Result
__call_c(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const __call_c(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const
{ {
return _M_f(_Mu<_Bound_args>() return _M_f(_Mu<_Bound_args>()
(get<_Indexes>(_M_bound_args), __args)...); (get<_Indexes>(_M_bound_args), __args)...);
} }
// Call as volatile // Call as volatile
template<typename _Result, typename... _Args, int... _Indexes> template<typename _Result, typename... _Args, int... _Indexes>
_Result _Result
__call_v(tuple<_Args...>&& __args, __call_v(tuple<_Args...>&& __args,
_Index_tuple<_Indexes...>) volatile _Index_tuple<_Indexes...>) volatile
{ {
return _M_f(_Mu<_Bound_args>() return _M_f(_Mu<_Bound_args>()
(__volget<_Indexes>(_M_bound_args), __args)...); (__volget<_Indexes>(_M_bound_args), __args)...);
} }
// Call as const volatile // Call as const volatile
template<typename _Result, typename... _Args, int... _Indexes> template<typename _Result, typename... _Args, int... _Indexes>
_Result _Result
__call_c_v(tuple<_Args...>&& __args, __call_c_v(tuple<_Args...>&& __args,
_Index_tuple<_Indexes...>) const volatile _Index_tuple<_Indexes...>) const volatile
{ {
return _M_f(_Mu<_Bound_args>() return _M_f(_Mu<_Bound_args>()
(__volget<_Indexes>(_M_bound_args), __args)...); (__volget<_Indexes>(_M_bound_args), __args)...);
} }
public: public:
template<typename... _Args> template<typename... _Args>
explicit _Bind(const _Functor& __f, _Args&&... __args) explicit _Bind(const _Functor& __f, _Args&&... __args)
: _M_f(__f), _M_bound_args(std::forward<_Args>(__args)...) : _M_f(__f), _M_bound_args(std::forward<_Args>(__args)...)
{ } { }
template<typename... _Args> template<typename... _Args>
explicit _Bind(_Functor&& __f, _Args&&... __args) explicit _Bind(_Functor&& __f, _Args&&... __args)
: _M_f(std::move(__f)), _M_bound_args(std::forward<_Args>(__args)...) : _M_f(std::move(__f)), _M_bound_args(std::forward<_Args>(__args)...)
{ } { }
_Bind(const _Bind&) = default; _Bind(const _Bind&) = default;
...@@ -1188,55 +1188,55 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1188,55 +1188,55 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// Call unqualified // Call unqualified
template<typename... _Args, typename _Result template<typename... _Args, typename _Result
= decltype( std::declval<_Functor>()( = decltype( std::declval<_Functor>()(
_Mu<_Bound_args>()( std::declval<_Bound_args&>(), _Mu<_Bound_args>()( std::declval<_Bound_args&>(),
std::declval<tuple<_Args...>&>() )... ) )> std::declval<tuple<_Args...>&>() )... ) )>
_Result _Result
operator()(_Args&&... __args) operator()(_Args&&... __args)
{ {
return this->__call<_Result>( return this->__call<_Result>(
std::forward_as_tuple(std::forward<_Args>(__args)...), std::forward_as_tuple(std::forward<_Args>(__args)...),
_Bound_indexes()); _Bound_indexes());
} }
// Call as const // Call as const
template<typename... _Args, typename _Result template<typename... _Args, typename _Result
= decltype( std::declval<const _Functor>()( = decltype( std::declval<const _Functor>()(
_Mu<_Bound_args>()( std::declval<const _Bound_args&>(), _Mu<_Bound_args>()( std::declval<const _Bound_args&>(),
std::declval<tuple<_Args...>&>() )... ) )> std::declval<tuple<_Args...>&>() )... ) )>
_Result _Result
operator()(_Args&&... __args) const operator()(_Args&&... __args) const
{ {
return this->__call_c<_Result>( return this->__call_c<_Result>(
std::forward_as_tuple(std::forward<_Args>(__args)...), std::forward_as_tuple(std::forward<_Args>(__args)...),
_Bound_indexes()); _Bound_indexes());
} }
// Call as volatile // Call as volatile
template<typename... _Args, typename _Result template<typename... _Args, typename _Result
= decltype( std::declval<volatile _Functor>()( = decltype( std::declval<volatile _Functor>()(
_Mu<_Bound_args>()( std::declval<volatile _Bound_args&>(), _Mu<_Bound_args>()( std::declval<volatile _Bound_args&>(),
std::declval<tuple<_Args...>&>() )... ) )> std::declval<tuple<_Args...>&>() )... ) )>
_Result _Result
operator()(_Args&&... __args) volatile operator()(_Args&&... __args) volatile
{ {
return this->__call_v<_Result>( return this->__call_v<_Result>(
std::forward_as_tuple(std::forward<_Args>(__args)...), std::forward_as_tuple(std::forward<_Args>(__args)...),
_Bound_indexes()); _Bound_indexes());
} }
// Call as const volatile // Call as const volatile
template<typename... _Args, typename _Result template<typename... _Args, typename _Result
= decltype( std::declval<const volatile _Functor>()( = decltype( std::declval<const volatile _Functor>()(
_Mu<_Bound_args>()( std::declval<const volatile _Bound_args&>(), _Mu<_Bound_args>()( std::declval<const volatile _Bound_args&>(),
std::declval<tuple<_Args...>&>() )... ) )> std::declval<tuple<_Args...>&>() )... ) )>
_Result _Result
operator()(_Args&&... __args) const volatile operator()(_Args&&... __args) const volatile
{ {
return this->__call_c_v<_Result>( return this->__call_c_v<_Result>(
std::forward_as_tuple(std::forward<_Args>(__args)...), std::forward_as_tuple(std::forward<_Args>(__args)...),
_Bound_indexes()); _Bound_indexes());
} }
}; };
/// Type of the function object returned from bind<R>(). /// Type of the function object returned from bind<R>().
...@@ -1247,111 +1247,111 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1247,111 +1247,111 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
class _Bind_result<_Result, _Functor(_Bound_args...)> class _Bind_result<_Result, _Functor(_Bound_args...)>
{ {
typedef _Bind_result __self_type; typedef _Bind_result __self_type;
typedef typename _Build_index_tuple<sizeof...(_Bound_args)>::__type typedef typename _Build_index_tuple<sizeof...(_Bound_args)>::__type
_Bound_indexes; _Bound_indexes;
_Functor _M_f; _Functor _M_f;
tuple<_Bound_args...> _M_bound_args; tuple<_Bound_args...> _M_bound_args;
// sfinae types // sfinae types
template<typename _Res> template<typename _Res>
struct __enable_if_void : enable_if<is_void<_Res>::value, int> { }; struct __enable_if_void : enable_if<is_void<_Res>::value, int> { };
template<typename _Res> template<typename _Res>
struct __disable_if_void : enable_if<!is_void<_Res>::value, int> { }; struct __disable_if_void : enable_if<!is_void<_Res>::value, int> { };
// Call unqualified // Call unqualified
template<typename _Res, typename... _Args, int... _Indexes> template<typename _Res, typename... _Args, int... _Indexes>
_Result _Result
__call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
typename __disable_if_void<_Res>::type = 0) typename __disable_if_void<_Res>::type = 0)
{ {
return _M_f(_Mu<_Bound_args>() return _M_f(_Mu<_Bound_args>()
(get<_Indexes>(_M_bound_args), __args)...); (get<_Indexes>(_M_bound_args), __args)...);
} }
// Call unqualified, return void // Call unqualified, return void
template<typename _Res, typename... _Args, int... _Indexes> template<typename _Res, typename... _Args, int... _Indexes>
void void
__call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
typename __enable_if_void<_Res>::type = 0) typename __enable_if_void<_Res>::type = 0)
{ {
_M_f(_Mu<_Bound_args>() _M_f(_Mu<_Bound_args>()
(get<_Indexes>(_M_bound_args), __args)...); (get<_Indexes>(_M_bound_args), __args)...);
} }
// Call as const // Call as const
template<typename _Res, typename... _Args, int... _Indexes> template<typename _Res, typename... _Args, int... _Indexes>
_Result _Result
__call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
typename __disable_if_void<_Res>::type = 0) const typename __disable_if_void<_Res>::type = 0) const
{ {
return _M_f(_Mu<_Bound_args>() return _M_f(_Mu<_Bound_args>()
(get<_Indexes>(_M_bound_args), __args)...); (get<_Indexes>(_M_bound_args), __args)...);
} }
// Call as const, return void // Call as const, return void
template<typename _Res, typename... _Args, int... _Indexes> template<typename _Res, typename... _Args, int... _Indexes>
void void
__call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
typename __enable_if_void<_Res>::type = 0) const typename __enable_if_void<_Res>::type = 0) const
{ {
_M_f(_Mu<_Bound_args>() _M_f(_Mu<_Bound_args>()
(get<_Indexes>(_M_bound_args), __args)...); (get<_Indexes>(_M_bound_args), __args)...);
} }
// Call as volatile // Call as volatile
template<typename _Res, typename... _Args, int... _Indexes> template<typename _Res, typename... _Args, int... _Indexes>
_Result _Result
__call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
typename __disable_if_void<_Res>::type = 0) volatile typename __disable_if_void<_Res>::type = 0) volatile
{ {
return _M_f(_Mu<_Bound_args>() return _M_f(_Mu<_Bound_args>()
(__volget<_Indexes>(_M_bound_args), __args)...); (__volget<_Indexes>(_M_bound_args), __args)...);
} }
// Call as volatile, return void // Call as volatile, return void
template<typename _Res, typename... _Args, int... _Indexes> template<typename _Res, typename... _Args, int... _Indexes>
void void
__call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
typename __enable_if_void<_Res>::type = 0) volatile typename __enable_if_void<_Res>::type = 0) volatile
{ {
_M_f(_Mu<_Bound_args>() _M_f(_Mu<_Bound_args>()
(__volget<_Indexes>(_M_bound_args), __args)...); (__volget<_Indexes>(_M_bound_args), __args)...);
} }
// Call as const volatile // Call as const volatile
template<typename _Res, typename... _Args, int... _Indexes> template<typename _Res, typename... _Args, int... _Indexes>
_Result _Result
__call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
typename __disable_if_void<_Res>::type = 0) const volatile typename __disable_if_void<_Res>::type = 0) const volatile
{ {
return _M_f(_Mu<_Bound_args>() return _M_f(_Mu<_Bound_args>()
(__volget<_Indexes>(_M_bound_args), __args)...); (__volget<_Indexes>(_M_bound_args), __args)...);
} }
// Call as const volatile, return void // Call as const volatile, return void
template<typename _Res, typename... _Args, int... _Indexes> template<typename _Res, typename... _Args, int... _Indexes>
void void
__call(tuple<_Args...>&& __args, __call(tuple<_Args...>&& __args,
_Index_tuple<_Indexes...>, _Index_tuple<_Indexes...>,
typename __enable_if_void<_Res>::type = 0) const volatile typename __enable_if_void<_Res>::type = 0) const volatile
{ {
_M_f(_Mu<_Bound_args>() _M_f(_Mu<_Bound_args>()
(__volget<_Indexes>(_M_bound_args), __args)...); (__volget<_Indexes>(_M_bound_args), __args)...);
} }
public: public:
typedef _Result result_type; typedef _Result result_type;
template<typename... _Args> template<typename... _Args>
explicit _Bind_result(const _Functor& __f, _Args&&... __args) explicit _Bind_result(const _Functor& __f, _Args&&... __args)
: _M_f(__f), _M_bound_args(std::forward<_Args>(__args)...) : _M_f(__f), _M_bound_args(std::forward<_Args>(__args)...)
{ } { }
template<typename... _Args> template<typename... _Args>
explicit _Bind_result(_Functor&& __f, _Args&&... __args) explicit _Bind_result(_Functor&& __f, _Args&&... __args)
: _M_f(std::move(__f)), _M_bound_args(std::forward<_Args>(__args)...) : _M_f(std::move(__f)), _M_bound_args(std::forward<_Args>(__args)...)
{ } { }
_Bind_result(const _Bind_result&) = default; _Bind_result(const _Bind_result&) = default;
...@@ -1361,43 +1361,43 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1361,43 +1361,43 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// Call unqualified // Call unqualified
template<typename... _Args> template<typename... _Args>
result_type result_type
operator()(_Args&&... __args) operator()(_Args&&... __args)
{ {
return this->__call<_Result>( return this->__call<_Result>(
std::forward_as_tuple(std::forward<_Args>(__args)...), std::forward_as_tuple(std::forward<_Args>(__args)...),
_Bound_indexes()); _Bound_indexes());
} }
// Call as const // Call as const
template<typename... _Args> template<typename... _Args>
result_type result_type
operator()(_Args&&... __args) const operator()(_Args&&... __args) const
{ {
return this->__call<_Result>( return this->__call<_Result>(
std::forward_as_tuple(std::forward<_Args>(__args)...), std::forward_as_tuple(std::forward<_Args>(__args)...),
_Bound_indexes()); _Bound_indexes());
} }
// Call as volatile // Call as volatile
template<typename... _Args> template<typename... _Args>
result_type result_type
operator()(_Args&&... __args) volatile operator()(_Args&&... __args) volatile
{ {
return this->__call<_Result>( return this->__call<_Result>(
std::forward_as_tuple(std::forward<_Args>(__args)...), std::forward_as_tuple(std::forward<_Args>(__args)...),
_Bound_indexes()); _Bound_indexes());
} }
// Call as const volatile // Call as const volatile
template<typename... _Args> template<typename... _Args>
result_type result_type
operator()(_Args&&... __args) const volatile operator()(_Args&&... __args) const volatile
{ {
return this->__call<_Result>( return this->__call<_Result>(
std::forward_as_tuple(std::forward<_Args>(__args)...), std::forward_as_tuple(std::forward<_Args>(__args)...),
_Bound_indexes()); _Bound_indexes());
} }
}; };
/** /**
...@@ -1420,7 +1420,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1420,7 +1420,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
struct _Bind_helper struct _Bind_helper
{ {
typedef _Maybe_wrap_member_pointer<typename decay<_Functor>::type> typedef _Maybe_wrap_member_pointer<typename decay<_Functor>::type>
__maybe_type; __maybe_type;
typedef typename __maybe_type::type __functor_type; typedef typename __maybe_type::type __functor_type;
typedef _Bind<__functor_type(typename decay<_ArgTypes>::type...)> type; typedef _Bind<__functor_type(typename decay<_ArgTypes>::type...)> type;
}; };
...@@ -1438,18 +1438,18 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1438,18 +1438,18 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
typedef typename __helper_type::__maybe_type __maybe_type; typedef typename __helper_type::__maybe_type __maybe_type;
typedef typename __helper_type::type __result_type; typedef typename __helper_type::type __result_type;
return __result_type(__maybe_type::__do_wrap(std::forward<_Functor>(__f)), return __result_type(__maybe_type::__do_wrap(std::forward<_Functor>(__f)),
std::forward<_ArgTypes>(__args)...); std::forward<_ArgTypes>(__args)...);
} }
template<typename _Result, typename _Functor, typename... _ArgTypes> template<typename _Result, typename _Functor, typename... _ArgTypes>
struct _Bindres_helper struct _Bindres_helper
{ {
typedef _Maybe_wrap_member_pointer<typename decay<_Functor>::type> typedef _Maybe_wrap_member_pointer<typename decay<_Functor>::type>
__maybe_type; __maybe_type;
typedef typename __maybe_type::type __functor_type; typedef typename __maybe_type::type __functor_type;
typedef _Bind_result<_Result, typedef _Bind_result<_Result,
__functor_type(typename decay<_ArgTypes>::type...)> __functor_type(typename decay<_ArgTypes>::type...)>
type; type;
}; };
/** /**
...@@ -1465,7 +1465,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1465,7 +1465,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
typedef typename __helper_type::__maybe_type __maybe_type; typedef typename __helper_type::__maybe_type __maybe_type;
typedef typename __helper_type::type __result_type; typedef typename __helper_type::type __result_type;
return __result_type(__maybe_type::__do_wrap(std::forward<_Functor>(__f)), return __result_type(__maybe_type::__do_wrap(std::forward<_Functor>(__f)),
std::forward<_ArgTypes>(__args)...); std::forward<_ArgTypes>(__args)...);
} }
/** /**
...@@ -1473,7 +1473,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1473,7 +1473,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* operator() is called with an empty target. * operator() is called with an empty target.
* @ingroup exceptions * @ingroup exceptions
*/ */
class bad_function_call : public std::exception { }; class bad_function_call : public std::exception
{
public:
virtual ~bad_function_call() throw();
};
/** /**
* Trait identifying "location-invariant" types, meaning that the * Trait identifying "location-invariant" types, meaning that the
...@@ -1570,11 +1574,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1570,11 +1574,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
{ {
protected: protected:
static const bool __stored_locally = static const bool __stored_locally =
(__is_location_invariant<_Functor>::value (__is_location_invariant<_Functor>::value
&& sizeof(_Functor) <= _M_max_size && sizeof(_Functor) <= _M_max_size
&& __alignof__(_Functor) <= _M_max_align && __alignof__(_Functor) <= _M_max_align
&& (_M_max_align % __alignof__(_Functor) == 0)); && (_M_max_align % __alignof__(_Functor) == 0));
typedef integral_constant<bool, __stored_locally> _Local_storage; typedef integral_constant<bool, __stored_locally> _Local_storage;
// Retrieve a pointer to the function object // Retrieve a pointer to the function object
...@@ -1611,14 +1615,14 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1611,14 +1615,14 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
{ {
__victim._M_access<_Functor>().~_Functor(); __victim._M_access<_Functor>().~_Functor();
} }
// Destroying an object located on the heap. // Destroying an object located on the heap.
static void static void
_M_destroy(_Any_data& __victim, false_type) _M_destroy(_Any_data& __victim, false_type)
{ {
delete __victim._M_access<_Functor*>(); delete __victim._M_access<_Functor*>();
} }
public: public:
static bool static bool
_M_manager(_Any_data& __dest, const _Any_data& __source, _M_manager(_Any_data& __dest, const _Any_data& __source,
...@@ -1634,7 +1638,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1634,7 +1638,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
case __get_functor_ptr: case __get_functor_ptr:
__dest._M_access<_Functor*>() = _M_get_pointer(__source); __dest._M_access<_Functor*>() = _M_get_pointer(__source);
break; break;
case __clone_functor: case __clone_functor:
_M_clone(__dest, __source, _Local_storage()); _M_clone(__dest, __source, _Local_storage());
break; break;
...@@ -1649,11 +1653,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1649,11 +1653,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
static void static void
_M_init_functor(_Any_data& __functor, _Functor&& __f) _M_init_functor(_Any_data& __functor, _Functor&& __f)
{ _M_init_functor(__functor, std::move(__f), _Local_storage()); } { _M_init_functor(__functor, std::move(__f), _Local_storage()); }
template<typename _Signature> template<typename _Signature>
static bool static bool
_M_not_empty_function(const function<_Signature>& __f) _M_not_empty_function(const function<_Signature>& __f)
{ return static_cast<bool>(__f); } { return static_cast<bool>(__f); }
template<typename _Tp> template<typename _Tp>
static bool static bool
...@@ -1671,7 +1675,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1671,7 +1675,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
{ return true; } { return true; }
private: private:
static void static void
_M_init_functor(_Any_data& __functor, _Functor&& __f, true_type) _M_init_functor(_Any_data& __functor, _Functor&& __f, true_type)
{ new (__functor._M_access()) _Functor(std::move(__f)); } { new (__functor._M_access()) _Functor(std::move(__f)); }
...@@ -1701,7 +1705,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1701,7 +1705,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
__dest._M_access<_Functor*>() = *_Base::_M_get_pointer(__source); __dest._M_access<_Functor*>() = *_Base::_M_get_pointer(__source);
return is_const<_Functor>::value; return is_const<_Functor>::value;
break; break;
default: default:
_Base::_M_manager(__dest, __source, __op); _Base::_M_manager(__dest, __source, __op);
} }
...@@ -1717,7 +1721,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1717,7 +1721,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
}; };
_Function_base() : _M_manager(0) { } _Function_base() : _M_manager(0) { }
~_Function_base() ~_Function_base()
{ {
if (_M_manager) if (_M_manager)
...@@ -1728,7 +1732,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1728,7 +1732,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
bool _M_empty() const { return !_M_manager; } bool _M_empty() const { return !_M_manager; }
typedef bool (*_Manager_type)(_Any_data&, const _Any_data&, typedef bool (*_Manager_type)(_Any_data&, const _Any_data&,
_Manager_operation); _Manager_operation);
_Any_data _M_functor; _Any_data _M_functor;
_Manager_type _M_manager; _Manager_type _M_manager;
...@@ -1747,8 +1751,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1747,8 +1751,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
static _Res static _Res
_M_invoke(const _Any_data& __functor, _ArgTypes... __args) _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
{ {
return (*_Base::_M_get_pointer(__functor))( return (*_Base::_M_get_pointer(__functor))(
std::forward<_ArgTypes>(__args)...); std::forward<_ArgTypes>(__args)...);
} }
}; };
...@@ -1762,8 +1766,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1762,8 +1766,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
static void static void
_M_invoke(const _Any_data& __functor, _ArgTypes... __args) _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
{ {
(*_Base::_M_get_pointer(__functor))( (*_Base::_M_get_pointer(__functor))(
std::forward<_ArgTypes>(__args)...); std::forward<_ArgTypes>(__args)...);
} }
}; };
...@@ -1777,8 +1781,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1777,8 +1781,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
static _Res static _Res
_M_invoke(const _Any_data& __functor, _ArgTypes... __args) _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
{ {
return __callable_functor(**_Base::_M_get_pointer(__functor))( return __callable_functor(**_Base::_M_get_pointer(__functor))(
std::forward<_ArgTypes>(__args)...); std::forward<_ArgTypes>(__args)...);
} }
}; };
...@@ -1792,32 +1796,32 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1792,32 +1796,32 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
static void static void
_M_invoke(const _Any_data& __functor, _ArgTypes... __args) _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
{ {
__callable_functor(**_Base::_M_get_pointer(__functor))( __callable_functor(**_Base::_M_get_pointer(__functor))(
std::forward<_ArgTypes>(__args)...); std::forward<_ArgTypes>(__args)...);
} }
}; };
template<typename _Class, typename _Member, typename _Res, template<typename _Class, typename _Member, typename _Res,
typename... _ArgTypes> typename... _ArgTypes>
class _Function_handler<_Res(_ArgTypes...), _Member _Class::*> class _Function_handler<_Res(_ArgTypes...), _Member _Class::*>
: public _Function_handler<void(_ArgTypes...), _Member _Class::*> : public _Function_handler<void(_ArgTypes...), _Member _Class::*>
{ {
typedef _Function_handler<void(_ArgTypes...), _Member _Class::*> typedef _Function_handler<void(_ArgTypes...), _Member _Class::*>
_Base; _Base;
public: public:
static _Res static _Res
_M_invoke(const _Any_data& __functor, _ArgTypes... __args) _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
{ {
return mem_fn(_Base::_M_get_pointer(__functor)->__value)( return mem_fn(_Base::_M_get_pointer(__functor)->__value)(
std::forward<_ArgTypes>(__args)...); std::forward<_ArgTypes>(__args)...);
} }
}; };
template<typename _Class, typename _Member, typename... _ArgTypes> template<typename _Class, typename _Member, typename... _ArgTypes>
class _Function_handler<void(_ArgTypes...), _Member _Class::*> class _Function_handler<void(_ArgTypes...), _Member _Class::*>
: public _Function_base::_Base_manager< : public _Function_base::_Base_manager<
_Simple_type_wrapper< _Member _Class::* > > _Simple_type_wrapper< _Member _Class::* > >
{ {
typedef _Member _Class::* _Functor; typedef _Member _Class::* _Functor;
typedef _Simple_type_wrapper<_Functor> _Wrapper; typedef _Simple_type_wrapper<_Functor> _Wrapper;
...@@ -1826,31 +1830,31 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1826,31 +1830,31 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
public: public:
static bool static bool
_M_manager(_Any_data& __dest, const _Any_data& __source, _M_manager(_Any_data& __dest, const _Any_data& __source,
_Manager_operation __op) _Manager_operation __op)
{ {
switch (__op) switch (__op)
{ {
#ifdef __GXX_RTTI #ifdef __GXX_RTTI
case __get_type_info: case __get_type_info:
__dest._M_access<const type_info*>() = &typeid(_Functor); __dest._M_access<const type_info*>() = &typeid(_Functor);
break; break;
#endif #endif
case __get_functor_ptr: case __get_functor_ptr:
__dest._M_access<_Functor*>() = __dest._M_access<_Functor*>() =
&_Base::_M_get_pointer(__source)->__value; &_Base::_M_get_pointer(__source)->__value;
break; break;
default: default:
_Base::_M_manager(__dest, __source, __op); _Base::_M_manager(__dest, __source, __op);
} }
return false; return false;
} }
static void static void
_M_invoke(const _Any_data& __functor, _ArgTypes... __args) _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
{ {
mem_fn(_Base::_M_get_pointer(__functor)->__value)( mem_fn(_Base::_M_get_pointer(__functor)->__value)(
std::forward<_ArgTypes>(__args)...); std::forward<_ArgTypes>(__args)...);
} }
}; };
...@@ -1866,26 +1870,26 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1866,26 +1870,26 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
private _Function_base private _Function_base
{ {
typedef _Res _Signature_type(_ArgTypes...); typedef _Res _Signature_type(_ArgTypes...);
struct _Useless { }; struct _Useless { };
public: public:
typedef _Res result_type; typedef _Res result_type;
// [3.7.2.1] construct/copy/destroy // [3.7.2.1] construct/copy/destroy
/** /**
* @brief Default construct creates an empty function call wrapper. * @brief Default construct creates an empty function call wrapper.
* @post @c !(bool)*this * @post @c !(bool)*this
*/ */
function() : _Function_base() { } function() : _Function_base() { }
/** /**
* @brief Creates an empty function call wrapper. * @brief Creates an empty function call wrapper.
* @post @c !(bool)*this * @post @c !(bool)*this
*/ */
function(nullptr_t) : _Function_base() { } function(nullptr_t) : _Function_base() { }
/** /**
* @brief %Function copy constructor. * @brief %Function copy constructor.
* @param x A %function object with identical call signature. * @param x A %function object with identical call signature.
...@@ -1905,11 +1909,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1905,11 +1909,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
*/ */
function(function&& __x) : _Function_base() function(function&& __x) : _Function_base()
{ {
__x.swap(*this); __x.swap(*this);
} }
// TODO: needs allocator_arg_t // TODO: needs allocator_arg_t
/** /**
* @brief Builds a %function that targets a copy of the incoming * @brief Builds a %function that targets a copy of the incoming
* function object. * function object.
...@@ -1927,10 +1931,10 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1927,10 +1931,10 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* reference_wrapper<F>, this function will not throw. * reference_wrapper<F>, this function will not throw.
*/ */
template<typename _Functor> template<typename _Functor>
function(_Functor __f, function(_Functor __f,
typename enable_if< typename enable_if<
!is_integral<_Functor>::value, _Useless>::type !is_integral<_Functor>::value, _Useless>::type
= _Useless()); = _Useless());
/** /**
* @brief %Function assignment operator. * @brief %Function assignment operator.
...@@ -1947,8 +1951,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1947,8 +1951,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
function& function&
operator=(const function& __x) operator=(const function& __x)
{ {
function(__x).swap(*this); function(__x).swap(*this);
return *this; return *this;
} }
/** /**
...@@ -1965,8 +1969,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1965,8 +1969,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
function& function&
operator=(function&& __x) operator=(function&& __x)
{ {
function(std::move(__x)).swap(*this); function(std::move(__x)).swap(*this);
return *this; return *this;
} }
/** /**
...@@ -1979,13 +1983,13 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -1979,13 +1983,13 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
function& function&
operator=(nullptr_t) operator=(nullptr_t)
{ {
if (_M_manager) if (_M_manager)
{ {
_M_manager(_M_functor, _M_functor, __destroy_functor); _M_manager(_M_functor, _M_functor, __destroy_functor);
_M_manager = 0; _M_manager = 0;
_M_invoker = 0; _M_invoker = 0;
} }
return *this; return *this;
} }
/** /**
...@@ -2005,7 +2009,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -2005,7 +2009,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* reference_wrapper<F>, this function will not throw. * reference_wrapper<F>, this function will not throw.
*/ */
template<typename _Functor> template<typename _Functor>
typename enable_if<!is_integral<_Functor>::value, function&>::type typename enable_if<!is_integral<_Functor>::value, function&>::type
operator=(_Functor&& __f) operator=(_Functor&& __f)
{ {
function(std::forward<_Functor>(__f)).swap(*this); function(std::forward<_Functor>(__f)).swap(*this);
...@@ -2014,7 +2018,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -2014,7 +2018,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
/// @overload /// @overload
template<typename _Functor> template<typename _Functor>
typename enable_if<!is_integral<_Functor>::value, function&>::type typename enable_if<!is_integral<_Functor>::value, function&>::type
operator=(reference_wrapper<_Functor> __f) operator=(reference_wrapper<_Functor> __f)
{ {
function(__f).swap(*this); function(__f).swap(*this);
...@@ -2022,7 +2026,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -2022,7 +2026,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
} }
// [3.7.2.2] function modifiers // [3.7.2.2] function modifiers
/** /**
* @brief Swap the targets of two %function objects. * @brief Swap the targets of two %function objects.
* @param f A %function with identical call signature. * @param f A %function with identical call signature.
...@@ -2040,14 +2044,14 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -2040,14 +2044,14 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// TODO: needs allocator_arg_t // TODO: needs allocator_arg_t
/* /*
template<typename _Functor, typename _Alloc> template<typename _Functor, typename _Alloc>
void void
assign(_Functor&& __f, const _Alloc& __a) assign(_Functor&& __f, const _Alloc& __a)
{ {
function(allocator_arg, __a, function(allocator_arg, __a,
std::forward<_Functor>(__f)).swap(*this); std::forward<_Functor>(__f)).swap(*this);
} }
*/ */
// [3.7.2.3] function capacity // [3.7.2.3] function capacity
/** /**
...@@ -2085,7 +2089,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -2085,7 +2089,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* This function will not throw an %exception. * This function will not throw an %exception.
*/ */
const type_info& target_type() const; const type_info& target_type() const;
/** /**
* @brief Access the stored target function object. * @brief Access the stored target function object.
* *
...@@ -2096,7 +2100,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -2096,7 +2100,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* This function will not throw an %exception. * This function will not throw an %exception.
*/ */
template<typename _Functor> _Functor* target(); template<typename _Functor> _Functor* target();
/// @overload /// @overload
template<typename _Functor> const _Functor* target() const; template<typename _Functor> const _Functor* target() const;
#endif #endif
...@@ -2125,7 +2129,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -2125,7 +2129,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
function<_Res(_ArgTypes...)>:: function<_Res(_ArgTypes...)>::
function(_Functor __f, function(_Functor __f,
typename enable_if< typename enable_if<
!is_integral<_Functor>::value, _Useless>::type) !is_integral<_Functor>::value, _Useless>::type)
: _Function_base() : _Function_base()
{ {
typedef _Function_handler<_Signature_type, _Functor> _My_handler; typedef _Function_handler<_Signature_type, _Functor> _My_handler;
...@@ -2144,7 +2148,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -2144,7 +2148,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
operator()(_ArgTypes... __args) const operator()(_ArgTypes... __args) const
{ {
if (_M_empty()) if (_M_empty())
__throw_bad_function_call(); __throw_bad_function_call();
return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...); return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...);
} }
...@@ -2155,11 +2159,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) ...@@ -2155,11 +2159,11 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
target_type() const target_type() const
{ {
if (_M_manager) if (_M_manager)
{ {
_Any_data __typeinfo_result; _Any_data __typeinfo_result;
_M_manager(__typeinfo_result, _M_functor, __get_type_info); _M_manager(__typeinfo_result, _M_functor, __get_type_info);
return *__typeinfo_result._M_access<const type_info*>(); return *__typeinfo_result._M_access<const type_info*>();
} }
else else
return typeid(void); return typeid(void);
} }
......
...@@ -160,7 +160,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -160,7 +160,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
exception_ptr _M_error; exception_ptr _M_error;
_Result_base() = default;
_Result_base(const _Result_base&) = delete; _Result_base(const _Result_base&) = delete;
_Result_base& operator=(const _Result_base&) = delete; _Result_base& operator=(const _Result_base&) = delete;
...@@ -173,7 +172,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -173,7 +172,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}; };
protected: protected:
~_Result_base(); _Result_base();
virtual ~_Result_base();
}; };
/// Result. /// Result.
...@@ -273,8 +273,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -273,8 +273,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
/// Shared state between a promise and one or more associated futures. /// Base class for state between a promise and one or more
class _State /// associated futures.
class _State_base
{ {
typedef _Ptr<_Result_base>::type _Ptr_type; typedef _Ptr<_Result_base>::type _Ptr_type;
...@@ -285,10 +286,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -285,10 +286,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
once_flag _M_once; once_flag _M_once;
public: public:
_State() : _M_result(), _M_retrieved(ATOMIC_FLAG_INIT) { } _State_base() : _M_result(), _M_retrieved(ATOMIC_FLAG_INIT) { }
_State_base(const _State_base&) = delete;
_State(const _State&) = delete; _State_base& operator=(const _State_base&) = delete;
_State& operator=(const _State&) = delete; virtual ~_State_base();
_Result_base& _Result_base&
wait() wait()
...@@ -296,7 +297,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -296,7 +297,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_run_deferred(); _M_run_deferred();
unique_lock<mutex> __lock(_M_mutex); unique_lock<mutex> __lock(_M_mutex);
if (!_M_ready()) if (!_M_ready())
_M_cond.wait(__lock, std::bind<bool>(&_State::_M_ready, this)); _M_cond.wait(__lock, std::bind<bool>(&_State_base::_M_ready, this));
return *_M_result; return *_M_result;
} }
...@@ -305,7 +306,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -305,7 +306,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
wait_for(const chrono::duration<_Rep, _Period>& __rel) wait_for(const chrono::duration<_Rep, _Period>& __rel)
{ {
unique_lock<mutex> __lock(_M_mutex); unique_lock<mutex> __lock(_M_mutex);
auto __bound = std::bind<bool>(&_State::_M_ready, this); auto __bound = std::bind<bool>(&_State_base::_M_ready, this);
return _M_ready() || _M_cond.wait_for(__lock, __rel, __bound); return _M_ready() || _M_cond.wait_for(__lock, __rel, __bound);
} }
...@@ -314,7 +315,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -314,7 +315,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
wait_until(const chrono::time_point<_Clock, _Duration>& __abs) wait_until(const chrono::time_point<_Clock, _Duration>& __abs)
{ {
unique_lock<mutex> __lock(_M_mutex); unique_lock<mutex> __lock(_M_mutex);
auto __bound = std::bind<bool>(&_State::_M_ready, this); auto __bound = std::bind<bool>(&_State_base::_M_ready, this);
return _M_ready() || _M_cond.wait_until(__lock, __abs, __bound); return _M_ready() || _M_cond.wait_until(__lock, __abs, __bound);
} }
...@@ -324,7 +325,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -324,7 +325,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
bool __set = __ignore_failure; bool __set = __ignore_failure;
// all calls to this function are serialized, // all calls to this function are serialized,
// side-effects of invoking __res only happen once // side-effects of invoking __res only happen once
call_once(_M_once, &_State::_M_do_set, this, ref(__res), call_once(_M_once, &_State_base::_M_do_set, this, ref(__res),
ref(__set)); ref(__set));
if (!__set) if (!__set)
__throw_future_error(int(future_errc::promise_already_satisfied)); __throw_future_error(int(future_errc::promise_already_satisfied));
...@@ -368,7 +369,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -368,7 +369,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename promise<_Res>::_Ptr_type operator()() typename promise<_Res>::_Ptr_type operator()()
{ {
_State::_S_check(_M_promise->_M_future); _State_base::_S_check(_M_promise->_M_future);
_M_promise->_M_storage->_M_set(_M_arg); _M_promise->_M_storage->_M_set(_M_arg);
return std::move(_M_promise->_M_storage); return std::move(_M_promise->_M_storage);
} }
...@@ -382,7 +383,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -382,7 +383,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
typename promise<_Res>::_Ptr_type operator()() typename promise<_Res>::_Ptr_type operator()()
{ {
_State::_S_check(_M_promise->_M_future); _State_base::_S_check(_M_promise->_M_future);
_M_promise->_M_storage->_M_set(std::move(_M_arg)); _M_promise->_M_storage->_M_set(std::move(_M_arg));
return std::move(_M_promise->_M_storage); return std::move(_M_promise->_M_storage);
} }
...@@ -398,7 +399,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -398,7 +399,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
typename promise<_Res>::_Ptr_type operator()() typename promise<_Res>::_Ptr_type operator()()
{ {
_State::_S_check(_M_promise->_M_future); _State_base::_S_check(_M_promise->_M_future);
_M_promise->_M_storage->_M_error = _M_ex; _M_promise->_M_storage->_M_error = _M_ex;
return std::move(_M_promise->_M_storage); return std::move(_M_promise->_M_storage);
} }
...@@ -463,8 +464,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -463,8 +464,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct _Task_setter; struct _Task_setter;
}; };
inline __future_base::_Result_base::~_Result_base() = default;
/// Partial specialization for reference types. /// Partial specialization for reference types.
template<typename _Res> template<typename _Res>
struct __future_base::_Result<_Res&> : __future_base::_Result_base struct __future_base::_Result<_Res&> : __future_base::_Result_base
...@@ -495,7 +494,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -495,7 +494,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
class __basic_future : public __future_base class __basic_future : public __future_base
{ {
protected: protected:
typedef shared_ptr<_State> __state_type; typedef shared_ptr<_State_base> __state_type;
typedef __future_base::_Result<_Res>& __result_type; typedef __future_base::_Result<_Res>& __result_type;
private: private:
...@@ -512,7 +511,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -512,7 +511,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
void void
wait() const wait() const
{ {
_State::_S_check(_M_state); _State_base::_S_check(_M_state);
_M_state->wait(); _M_state->wait();
} }
...@@ -520,7 +519,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -520,7 +519,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
bool bool
wait_for(const chrono::duration<_Rep, _Period>& __rel) const wait_for(const chrono::duration<_Rep, _Period>& __rel) const
{ {
_State::_S_check(_M_state); _State_base::_S_check(_M_state);
return _M_state->wait_for(__rel); return _M_state->wait_for(__rel);
} }
...@@ -528,7 +527,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -528,7 +527,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
bool bool
wait_until(const chrono::time_point<_Clock, _Duration>& __abs) const wait_until(const chrono::time_point<_Clock, _Duration>& __abs) const
{ {
_State::_S_check(_M_state); _State_base::_S_check(_M_state);
return _M_state->wait_until(__abs); return _M_state->wait_until(__abs);
} }
...@@ -537,7 +536,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -537,7 +536,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__result_type __result_type
_M_get_result() _M_get_result()
{ {
_State::_S_check(_M_state); _State_base::_S_check(_M_state);
_Result_base& __res = _M_state->wait(); _Result_base& __res = _M_state->wait();
if (!(__res._M_error == 0)) if (!(__res._M_error == 0))
rethrow_exception(__res._M_error); rethrow_exception(__res._M_error);
...@@ -553,7 +552,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -553,7 +552,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
explicit explicit
__basic_future(const __state_type& __state) : _M_state(__state) __basic_future(const __state_type& __state) : _M_state(__state)
{ {
_State::_S_check(_M_state); _State_base::_S_check(_M_state);
_M_state->_M_set_retrieved_flag(); _M_state->_M_set_retrieved_flag();
} }
...@@ -850,9 +849,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -850,9 +849,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Res> template<typename _Res>
class promise class promise
{ {
typedef __future_base::_State _State; typedef __future_base::_State_base _State;
typedef __future_base::_Result<_Res> _Res_type; typedef __future_base::_Result<_Res> _Res_type;
typedef typename __future_base::_Ptr<_Res_type>::type _Ptr_type; typedef typename __future_base::_Ptr<_Res_type>::type _Ptr_type;
template<typename, typename> friend class _State::_Setter; template<typename, typename> friend class _State::_Setter;
shared_ptr<_State> _M_future; shared_ptr<_State> _M_future;
...@@ -942,9 +941,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -942,9 +941,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Res> template<typename _Res>
class promise<_Res&> class promise<_Res&>
{ {
typedef __future_base::_State _State; typedef __future_base::_State_base _State;
typedef __future_base::_Result<_Res&> _Res_type; typedef __future_base::_Result<_Res&> _Res_type;
typedef typename __future_base::_Ptr<_Res_type>::type _Ptr_type; typedef typename __future_base::_Ptr<_Res_type>::type _Ptr_type;
template<typename, typename> friend class _State::_Setter; template<typename, typename> friend class _State::_Setter;
shared_ptr<_State> _M_future; shared_ptr<_State> _M_future;
...@@ -1017,9 +1016,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1017,9 +1016,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<> template<>
class promise<void> class promise<void>
{ {
typedef __future_base::_State _State; typedef __future_base::_State_base _State;
typedef __future_base::_Result<void> _Res_type; typedef __future_base::_Result<void> _Res_type;
typedef typename __future_base::_Ptr<_Res_type>::type _Ptr_type; typedef typename __future_base::_Ptr<_Res_type>::type _Ptr_type;
template<typename, typename> friend class _State::_Setter; template<typename, typename> friend class _State::_Setter;
shared_ptr<_State> _M_future; shared_ptr<_State> _M_future;
...@@ -1085,19 +1084,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1085,19 +1084,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// set void // set void
template<> template<>
struct __future_base::_State::_Setter<void, void> struct __future_base::_State_base::_Setter<void, void>
{ {
promise<void>::_Ptr_type operator()() promise<void>::_Ptr_type operator()()
{ {
_State::_S_check(_M_promise->_M_future); _State_base::_S_check(_M_promise->_M_future);
return std::move(_M_promise->_M_storage); return std::move(_M_promise->_M_storage);
} }
promise<void>* _M_promise; promise<void>* _M_promise;
}; };
inline __future_base::_State::_Setter<void, void> inline __future_base::_State_base::_Setter<void, void>
__future_base::_State::__setter(promise<void>* __prom) __future_base::_State_base::__setter(promise<void>* __prom)
{ {
return _Setter<void, void>{ __prom }; return _Setter<void, void>{ __prom };
} }
...@@ -1149,7 +1148,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1149,7 +1148,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}; };
template<typename _Res, typename... _Args> template<typename _Res, typename... _Args>
struct __future_base::_Task_state<_Res(_Args...)> : __future_base::_State struct __future_base::_Task_state<_Res(_Args...)>
: __future_base::_State_base
{ {
typedef _Res _Res_type; typedef _Res _Res_type;
...@@ -1263,14 +1263,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1263,14 +1263,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
void void
operator()(_ArgTypes... __args) operator()(_ArgTypes... __args)
{ {
__future_base::_State::_S_check(_M_state); __future_base::_State_base::_S_check(_M_state);
_M_state->_M_run(std::forward<_ArgTypes>(__args)...); _M_state->_M_run(std::forward<_ArgTypes>(__args)...);
} }
void void
reset() reset()
{ {
__future_base::_State::_S_check(_M_state); __future_base::_State_base::_S_check(_M_state);
packaged_task(std::move(_M_state->_M_task)).swap(*this); packaged_task(std::move(_M_state->_M_task)).swap(*this);
} }
}; };
...@@ -1288,7 +1288,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1288,7 +1288,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Res> template<typename _Res>
class __future_base::_Deferred_state : public __future_base::_State class __future_base::_Deferred_state : public __future_base::_State_base
{ {
public: public:
typedef _Res _Res_type; typedef _Res _Res_type;
...@@ -1314,7 +1314,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1314,7 +1314,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}; };
template<typename _Res> template<typename _Res>
class __future_base::_Async_state : public __future_base::_State class __future_base::_Async_state : public __future_base::_State_base
{ {
public: public:
typedef _Res _Res_type; typedef _Res _Res_type;
...@@ -1347,7 +1347,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1347,7 +1347,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
async(launch __policy, _Fn&& __fn, _Args&&... __args) async(launch __policy, _Fn&& __fn, _Args&&... __args)
{ {
typedef typename result_of<_Fn(_Args...)>::type result_type; typedef typename result_of<_Fn(_Args...)>::type result_type;
std::shared_ptr<__future_base::_State> __state; std::shared_ptr<__future_base::_State_base> __state;
if (__policy == launch::async) if (__policy == launch::async)
{ {
typedef typename __future_base::_Async_state<result_type> _State; typedef typename __future_base::_Async_state<result_type> _State;
......
// Standard exception classes -*- C++ -*- // Standard exception classes -*- C++ -*-
// Copyright (C) 2001, 2002, 2005, 2007, 2009, 2010 // Copyright (C) 2001, 2002, 2005, 2007, 2009, 2010, 2011
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -62,8 +62,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -62,8 +62,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
explicit explicit
logic_error(const string& __arg); logic_error(const string& __arg);
virtual virtual ~logic_error() throw();
~logic_error() throw();
/** Returns a C-style character string describing the general cause of /** Returns a C-style character string describing the general cause of
* the current error (the same string passed to the ctor). */ * the current error (the same string passed to the ctor). */
...@@ -77,6 +76,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -77,6 +76,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
public: public:
explicit domain_error(const string& __arg); explicit domain_error(const string& __arg);
virtual ~domain_error() throw();
}; };
/** Thrown to report invalid arguments to functions. */ /** Thrown to report invalid arguments to functions. */
...@@ -84,6 +84,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -84,6 +84,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
public: public:
explicit invalid_argument(const string& __arg); explicit invalid_argument(const string& __arg);
virtual ~invalid_argument() throw();
}; };
/** Thrown when an object is constructed that would exceed its maximum /** Thrown when an object is constructed that would exceed its maximum
...@@ -92,6 +93,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -92,6 +93,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
public: public:
explicit length_error(const string& __arg); explicit length_error(const string& __arg);
virtual ~length_error() throw();
}; };
/** This represents an argument whose value is not within the expected /** This represents an argument whose value is not within the expected
...@@ -100,6 +102,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -100,6 +102,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
public: public:
explicit out_of_range(const string& __arg); explicit out_of_range(const string& __arg);
virtual ~out_of_range() throw();
}; };
/** Runtime errors represent problems outside the scope of a program; /** Runtime errors represent problems outside the scope of a program;
...@@ -116,8 +119,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -116,8 +119,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
explicit explicit
runtime_error(const string& __arg); runtime_error(const string& __arg);
virtual virtual ~runtime_error() throw();
~runtime_error() throw();
/** Returns a C-style character string describing the general cause of /** Returns a C-style character string describing the general cause of
* the current error (the same string passed to the ctor). */ * the current error (the same string passed to the ctor). */
...@@ -130,6 +132,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -130,6 +132,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
public: public:
explicit range_error(const string& __arg); explicit range_error(const string& __arg);
virtual ~range_error() throw();
}; };
/** Thrown to indicate arithmetic overflow. */ /** Thrown to indicate arithmetic overflow. */
...@@ -137,6 +140,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -137,6 +140,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
public: public:
explicit overflow_error(const string& __arg); explicit overflow_error(const string& __arg);
virtual ~overflow_error() throw();
}; };
/** Thrown to indicate arithmetic underflow. */ /** Thrown to indicate arithmetic underflow. */
...@@ -144,6 +148,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -144,6 +148,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
public: public:
explicit underflow_error(const string& __arg); explicit underflow_error(const string& __arg);
virtual ~underflow_error() throw();
}; };
// @} group exceptions // @} group exceptions
......
// <system_error> -*- C++ -*- // <system_error> -*- C++ -*-
// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. // Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -69,7 +69,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -69,7 +69,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
error_category(); error_category();
public: public:
virtual ~error_category() { } virtual ~error_category();
error_category(const error_category&) = delete; error_category(const error_category&) = delete;
error_category& operator=(const error_category&) = delete; error_category& operator=(const error_category&) = delete;
...@@ -102,8 +102,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -102,8 +102,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return this != &__other; } { return this != &__other; }
}; };
inline error_category::error_category() = default;
// DR 890. // DR 890.
_GLIBCXX_CONST const error_category& system_category() throw(); _GLIBCXX_CONST const error_category& system_category() throw();
_GLIBCXX_CONST const error_category& generic_category() throw(); _GLIBCXX_CONST const error_category& generic_category() throw();
......
...@@ -100,7 +100,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -100,7 +100,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
__shared_base_type _M_this_ptr; __shared_base_type _M_this_ptr;
inline virtual ~_Impl_base(); virtual ~_Impl_base();
virtual void _M_run() = 0; virtual void _M_run() = 0;
}; };
...@@ -195,8 +195,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -195,8 +195,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
}; };
inline thread::_Impl_base::~_Impl_base() = default;
inline void inline void
swap(thread& __x, thread& __y) swap(thread& __x, thread& __y)
{ __x.swap(__y); } { __x.swap(__y); }
......
...@@ -77,6 +77,7 @@ sources = \ ...@@ -77,6 +77,7 @@ sources = \
guard.cc \ guard.cc \
guard_error.cc \ guard_error.cc \
hash_bytes.cc \ hash_bytes.cc \
nested_exception.cc \
new_handler.cc \ new_handler.cc \
new_op.cc \ new_op.cc \
new_opnt.cc \ new_opnt.cc \
...@@ -134,6 +135,11 @@ cp-demangle.o: cp-demangle.c ...@@ -134,6 +135,11 @@ cp-demangle.o: cp-demangle.c
$(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $< $(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
nested_exception.lo: nested_exception.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
nested_exception.o: nested_exception.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
# Libtool notes # Libtool notes
# 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
......
...@@ -98,10 +98,10 @@ am__objects_1 = array_type_info.lo atexit_arm.lo bad_alloc.lo \ ...@@ -98,10 +98,10 @@ am__objects_1 = array_type_info.lo atexit_arm.lo bad_alloc.lo \
eh_term_handler.lo eh_terminate.lo eh_throw.lo eh_type.lo \ eh_term_handler.lo eh_terminate.lo eh_throw.lo eh_type.lo \
eh_unex_handler.lo enum_type_info.lo function_type_info.lo \ eh_unex_handler.lo enum_type_info.lo function_type_info.lo \
fundamental_type_info.lo guard.lo guard_error.lo hash_bytes.lo \ fundamental_type_info.lo guard.lo guard_error.lo hash_bytes.lo \
new_handler.lo new_op.lo new_opnt.lo new_opv.lo new_opvnt.lo \ nested_exception.lo new_handler.lo new_op.lo new_opnt.lo \
pbase_type_info.lo pmem_type_info.lo pointer_type_info.lo \ new_opv.lo new_opvnt.lo pbase_type_info.lo pmem_type_info.lo \
pure.lo si_class_type_info.lo tinfo.lo tinfo2.lo vec.lo \ pointer_type_info.lo pure.lo si_class_type_info.lo tinfo.lo \
vmi_class_type_info.lo vterminate.lo tinfo2.lo vec.lo vmi_class_type_info.lo vterminate.lo
@GLIBCXX_HOSTED_TRUE@am__objects_2 = cp-demangle.lo @GLIBCXX_HOSTED_TRUE@am__objects_2 = cp-demangle.lo
am_libsupc___la_OBJECTS = $(am__objects_1) $(am__objects_2) am_libsupc___la_OBJECTS = $(am__objects_1) $(am__objects_2)
libsupc___la_OBJECTS = $(am_libsupc___la_OBJECTS) libsupc___la_OBJECTS = $(am_libsupc___la_OBJECTS)
...@@ -383,6 +383,7 @@ sources = \ ...@@ -383,6 +383,7 @@ sources = \
guard.cc \ guard.cc \
guard_error.cc \ guard_error.cc \
hash_bytes.cc \ hash_bytes.cc \
nested_exception.cc \
new_handler.cc \ new_handler.cc \
new_op.cc \ new_op.cc \
new_opnt.cc \ new_opnt.cc \
...@@ -766,6 +767,11 @@ cp-demangle.lo: cp-demangle.c ...@@ -766,6 +767,11 @@ cp-demangle.lo: cp-demangle.c
cp-demangle.o: cp-demangle.c cp-demangle.o: cp-demangle.c
$(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $< $(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
nested_exception.lo: nested_exception.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
nested_exception.o: nested_exception.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
install-stdHEADERS: $(std_HEADERS) install-stdHEADERS: $(std_HEADERS)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(stddir) $(mkinstalldirs) $(DESTDIR)$(stddir)
......
// Copyright (C) 2011 Free Software Foundation
//
// This file is part of GCC.
//
// GCC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3, or (at your option)
// any later version.
// GCC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
#include <exception>
namespace std
{
nested_exception::~nested_exception() = default;
} // namespace std
...@@ -63,7 +63,7 @@ namespace std ...@@ -63,7 +63,7 @@ namespace std
nested_exception& operator=(const nested_exception&) = default; nested_exception& operator=(const nested_exception&) = default;
inline virtual ~nested_exception(); virtual ~nested_exception();
void void
rethrow_nested() const __attribute__ ((__noreturn__)) rethrow_nested() const __attribute__ ((__noreturn__))
...@@ -74,8 +74,6 @@ namespace std ...@@ -74,8 +74,6 @@ namespace std
{ return _M_ptr; } { return _M_ptr; }
}; };
inline nested_exception::~nested_exception() = default;
template<typename _Except> template<typename _Except>
struct _Nested_exception : public _Except, public nested_exception struct _Nested_exception : public _Except, public nested_exception
{ {
......
...@@ -201,6 +201,7 @@ sources = \ ...@@ -201,6 +201,7 @@ sources = \
ctype.cc \ ctype.cc \
debug.cc \ debug.cc \
functexcept.cc \ functexcept.cc \
functional.cc \
globals_io.cc \ globals_io.cc \
hash_c++0x.cc \ hash_c++0x.cc \
hash_tr1.cc \ hash_tr1.cc \
...@@ -225,6 +226,7 @@ sources = \ ...@@ -225,6 +226,7 @@ sources = \
istream.cc \ istream.cc \
placeholders.cc \ placeholders.cc \
regex.cc \ regex.cc \
shared_ptr.cc \
streambuf.cc \ streambuf.cc \
mutex.cc \ mutex.cc \
condition_variable.cc \ condition_variable.cc \
...@@ -292,6 +294,11 @@ functexcept.lo: functexcept.cc ...@@ -292,6 +294,11 @@ functexcept.lo: functexcept.cc
functexcept.o: functexcept.cc functexcept.o: functexcept.cc
$(CXXCOMPILE) -std=gnu++0x -c $< $(CXXCOMPILE) -std=gnu++0x -c $<
shared_ptr.lo: shared_ptr.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
shared_ptr.o: shared_ptr.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
system_error.lo: system_error.cc system_error.lo: system_error.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $< $(LTCXXCOMPILE) -std=gnu++0x -c $<
system_error.o: system_error.cc system_error.o: system_error.cc
...@@ -312,6 +319,11 @@ compatibility-c++0x.lo: compatibility-c++0x.cc ...@@ -312,6 +319,11 @@ compatibility-c++0x.lo: compatibility-c++0x.cc
compatibility-c++0x.o: compatibility-c++0x.cc compatibility-c++0x.o: compatibility-c++0x.cc
$(CXXCOMPILE) -std=gnu++0x -c $< $(CXXCOMPILE) -std=gnu++0x -c $<
functional.lo: functional.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
functional.o: functional.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
hash_c++0x.lo: hash_c++0x.cc hash_c++0x.lo: hash_c++0x.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $< $(LTCXXCOMPILE) -std=gnu++0x -c $<
hash_c++0x.o: hash_c++0x.cc hash_c++0x.o: hash_c++0x.cc
......
...@@ -110,13 +110,13 @@ am__objects_6 = atomic.lo bitmap_allocator.lo pool_allocator.lo \ ...@@ -110,13 +110,13 @@ am__objects_6 = atomic.lo bitmap_allocator.lo pool_allocator.lo \
compatibility-c++0x.lo compatibility-debug_list.lo \ compatibility-c++0x.lo compatibility-debug_list.lo \
compatibility-debug_list-2.lo compatibility-list.lo \ compatibility-debug_list-2.lo compatibility-list.lo \
compatibility-list-2.lo complex_io.lo ctype.lo debug.lo \ compatibility-list-2.lo complex_io.lo ctype.lo debug.lo \
functexcept.lo globals_io.lo hash_c++0x.lo hash_tr1.lo \ functexcept.lo functional.lo globals_io.lo hash_c++0x.lo \
hashtable_c++0x.lo hashtable_tr1.lo ios.lo ios_failure.lo \ hash_tr1.lo hashtable_c++0x.lo hashtable_tr1.lo ios.lo \
ios_init.lo ios_locale.lo limits.lo list.lo locale.lo \ ios_failure.lo ios_init.lo ios_locale.lo limits.lo list.lo \
locale_init.lo locale_facets.lo localename.lo \ locale.lo locale_init.lo locale_facets.lo localename.lo \
math_stubs_float.lo math_stubs_long_double.lo stdexcept.lo \ math_stubs_float.lo math_stubs_long_double.lo stdexcept.lo \
strstream.lo system_error.lo tree.lo istream.lo \ strstream.lo system_error.lo tree.lo istream.lo \
placeholders.lo regex.lo streambuf.lo mutex.lo \ placeholders.lo regex.lo shared_ptr.lo streambuf.lo mutex.lo \
condition_variable.lo chrono.lo thread.lo future.lo \ condition_variable.lo chrono.lo thread.lo future.lo \
valarray.lo $(am__objects_1) $(am__objects_5) valarray.lo $(am__objects_1) $(am__objects_5)
am_libstdc___la_OBJECTS = $(am__objects_6) am_libstdc___la_OBJECTS = $(am__objects_6)
...@@ -420,6 +420,7 @@ sources = \ ...@@ -420,6 +420,7 @@ sources = \
ctype.cc \ ctype.cc \
debug.cc \ debug.cc \
functexcept.cc \ functexcept.cc \
functional.cc \
globals_io.cc \ globals_io.cc \
hash_c++0x.cc \ hash_c++0x.cc \
hash_tr1.cc \ hash_tr1.cc \
...@@ -444,6 +445,7 @@ sources = \ ...@@ -444,6 +445,7 @@ sources = \
istream.cc \ istream.cc \
placeholders.cc \ placeholders.cc \
regex.cc \ regex.cc \
shared_ptr.cc \
streambuf.cc \ streambuf.cc \
mutex.cc \ mutex.cc \
condition_variable.cc \ condition_variable.cc \
...@@ -885,6 +887,11 @@ functexcept.lo: functexcept.cc ...@@ -885,6 +887,11 @@ functexcept.lo: functexcept.cc
functexcept.o: functexcept.cc functexcept.o: functexcept.cc
$(CXXCOMPILE) -std=gnu++0x -c $< $(CXXCOMPILE) -std=gnu++0x -c $<
shared_ptr.lo: shared_ptr.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
shared_ptr.o: shared_ptr.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
system_error.lo: system_error.cc system_error.lo: system_error.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $< $(LTCXXCOMPILE) -std=gnu++0x -c $<
system_error.o: system_error.cc system_error.o: system_error.cc
...@@ -905,6 +912,11 @@ compatibility-c++0x.lo: compatibility-c++0x.cc ...@@ -905,6 +912,11 @@ compatibility-c++0x.lo: compatibility-c++0x.cc
compatibility-c++0x.o: compatibility-c++0x.cc compatibility-c++0x.o: compatibility-c++0x.cc
$(CXXCOMPILE) -std=gnu++0x -c $< $(CXXCOMPILE) -std=gnu++0x -c $<
functional.lo: functional.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
functional.o: functional.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
hash_c++0x.lo: hash_c++0x.cc hash_c++0x.lo: hash_c++0x.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $< $(LTCXXCOMPILE) -std=gnu++0x -c $<
hash_c++0x.o: hash_c++0x.cc hash_c++0x.o: hash_c++0x.cc
......
// Support for <functional> -*- C++ -*-
// Copyright (C) 2011
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
#include <functional>
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
bad_function_call::~bad_function_call() throw() = default;
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
...@@ -79,8 +79,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -79,8 +79,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const char* const char*
future_error::what() const throw() { return _M_code.message().c_str(); } future_error::what() const throw() { return _M_code.message().c_str(); }
__future_base::_Result_base::_Result_base() = default;
__future_base::_Result_base::~_Result_base() = default;
__future_base::_State_base::~_State_base() = default;
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace std
// XXX GLIBCXX_ABI Deprecated // XXX GLIBCXX_ABI Deprecated
// gcc-4.6.0 // gcc-4.6.0
......
// Support for pointer abstractions -*- C++ -*-
// Copyright (C) 2011
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
#include <memory>
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
bad_weak_ptr::~bad_weak_ptr() throw() = default;
char const*
bad_weak_ptr::what() const throw()
{ return "std::bad_weak_ptr"; }
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
// Methods for Exception Support for -*- C++ -*- // Methods for Exception Support for -*- C++ -*-
// Copyright (C) 1997, 1999, 2001, 2002, 2005, 2009 // Copyright (C) 1997, 1999, 2001, 2002, 2005, 2009, 2011
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -34,7 +34,7 @@ namespace std _GLIBCXX_VISIBILITY(default) ...@@ -34,7 +34,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
logic_error::logic_error(const string& __arg) logic_error::logic_error(const string& __arg)
: exception(), _M_msg(__arg) { } : exception(), _M_msg(__arg) { }
logic_error::~logic_error() throw() { } logic_error::~logic_error() throw() { }
...@@ -46,16 +46,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -46,16 +46,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
domain_error::domain_error(const string& __arg) domain_error::domain_error(const string& __arg)
: logic_error(__arg) { } : logic_error(__arg) { }
domain_error::~domain_error() throw() { }
invalid_argument::invalid_argument(const string& __arg) invalid_argument::invalid_argument(const string& __arg)
: logic_error(__arg) { } : logic_error(__arg) { }
invalid_argument::~invalid_argument() throw() { }
length_error::length_error(const string& __arg) length_error::length_error(const string& __arg)
: logic_error(__arg) { } : logic_error(__arg) { }
length_error::~length_error() throw() { }
out_of_range::out_of_range(const string& __arg) out_of_range::out_of_range(const string& __arg)
: logic_error(__arg) { } : logic_error(__arg) { }
runtime_error::runtime_error(const string& __arg) out_of_range::~out_of_range() throw() { }
runtime_error::runtime_error(const string& __arg)
: exception(), _M_msg(__arg) { } : exception(), _M_msg(__arg) { }
runtime_error::~runtime_error() throw() { } runtime_error::~runtime_error() throw() { }
...@@ -67,12 +75,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -67,12 +75,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
range_error::range_error(const string& __arg) range_error::range_error(const string& __arg)
: runtime_error(__arg) { } : runtime_error(__arg) { }
range_error::~range_error() throw() { }
overflow_error::overflow_error(const string& __arg) overflow_error::overflow_error(const string& __arg)
: runtime_error(__arg) { } : runtime_error(__arg) { }
overflow_error::~overflow_error() throw() { }
underflow_error::underflow_error(const string& __arg) underflow_error::underflow_error(const string& __arg)
: runtime_error(__arg) { } : runtime_error(__arg) { }
underflow_error::~underflow_error() throw() { }
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
// <system_error> implementation file // <system_error> implementation file
// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. // Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -74,13 +74,17 @@ namespace std _GLIBCXX_VISIBILITY(default) ...@@ -74,13 +74,17 @@ namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
error_category::error_category() = default;
error_category::~error_category() = default;
const error_category& const error_category&
system_category() throw() { return system_category_instance; } system_category() throw() { return system_category_instance; }
const error_category& const error_category&
generic_category() throw() { return generic_category_instance; } generic_category() throw() { return generic_category_instance; }
system_error::~system_error() throw() { } system_error::~system_error() throw() = default;
error_condition error_condition
error_category::default_error_condition(int __i) const error_category::default_error_condition(int __i) const
......
...@@ -54,6 +54,8 @@ namespace std _GLIBCXX_VISIBILITY(default) ...@@ -54,6 +54,8 @@ namespace std _GLIBCXX_VISIBILITY(default)
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
thread::_Impl_base::~_Impl_base() = default;
void void
thread::join() thread::join()
{ {
......
...@@ -32,9 +32,9 @@ void test01() ...@@ -32,9 +32,9 @@ void test01()
{ {
X* px = 0; X* px = 0;
std::shared_ptr<X> p1(px); // { dg-error "here" } std::shared_ptr<X> p1(px); // { dg-error "here" }
// { dg-error "incomplete" "" { target *-*-* } 765 } // { dg-error "incomplete" "" { target *-*-* } 766 }
std::shared_ptr<X> p9(ap()); // { dg-error "here" } std::shared_ptr<X> p9(ap()); // { dg-error "here" }
// { dg-error "incomplete" "" { target *-*-* } 857 } // { dg-error "incomplete" "" { target *-*-* } 858 }
} }
...@@ -43,7 +43,7 @@ main() ...@@ -43,7 +43,7 @@ main()
} }
// { dg-warning "note" "" { target *-*-* } 354 } // { dg-warning "note" "" { target *-*-* } 354 }
// { dg-warning "note" "" { target *-*-* } 1085 } // { dg-warning "note" "" { target *-*-* } 1086 }
// { dg-warning "note" "" { target *-*-* } 467 } // { dg-warning "note" "" { target *-*-* } 467 }
// { dg-warning "note" "" { target *-*-* } 587 } // { dg-warning "note" "" { target *-*-* } 587 }
// { dg-warning "note" "" { target *-*-* } 1050 } // { dg-warning "note" "" { target *-*-* } 1050 }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment