diff --git a/README.md b/README.md
index 0cb32efb5..2f32aa698 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
## What's installed ##
This cut down development environment has been created specifically for Windows users.
- * devkitARM r45
+ * devkitARM r47
* gcc 5.3.0
* Qt 5.6
* perl 5.24.0
diff --git a/devkitARM/arm-none-eabi/bin/ar.exe b/devkitARM/arm-none-eabi/bin/ar.exe
index 43c596af7..e65d21f62 100644
Binary files a/devkitARM/arm-none-eabi/bin/ar.exe and b/devkitARM/arm-none-eabi/bin/ar.exe differ
diff --git a/devkitARM/arm-none-eabi/bin/as.exe b/devkitARM/arm-none-eabi/bin/as.exe
index ee5a072b2..ed898ddf2 100644
Binary files a/devkitARM/arm-none-eabi/bin/as.exe and b/devkitARM/arm-none-eabi/bin/as.exe differ
diff --git a/devkitARM/arm-none-eabi/bin/ld.bfd.exe b/devkitARM/arm-none-eabi/bin/ld.bfd.exe
index 1ab7ef814..b47795e1b 100644
Binary files a/devkitARM/arm-none-eabi/bin/ld.bfd.exe and b/devkitARM/arm-none-eabi/bin/ld.bfd.exe differ
diff --git a/devkitARM/arm-none-eabi/bin/ld.exe b/devkitARM/arm-none-eabi/bin/ld.exe
index 1ab7ef814..b47795e1b 100644
Binary files a/devkitARM/arm-none-eabi/bin/ld.exe and b/devkitARM/arm-none-eabi/bin/ld.exe differ
diff --git a/devkitARM/arm-none-eabi/bin/nm.exe b/devkitARM/arm-none-eabi/bin/nm.exe
index 03511aa12..0cfe7125b 100644
Binary files a/devkitARM/arm-none-eabi/bin/nm.exe and b/devkitARM/arm-none-eabi/bin/nm.exe differ
diff --git a/devkitARM/arm-none-eabi/bin/objcopy.exe b/devkitARM/arm-none-eabi/bin/objcopy.exe
index f5c6da1b1..64f2ec37b 100644
Binary files a/devkitARM/arm-none-eabi/bin/objcopy.exe and b/devkitARM/arm-none-eabi/bin/objcopy.exe differ
diff --git a/devkitARM/arm-none-eabi/bin/objdump.exe b/devkitARM/arm-none-eabi/bin/objdump.exe
index 318ae2e26..8167c57e3 100644
Binary files a/devkitARM/arm-none-eabi/bin/objdump.exe and b/devkitARM/arm-none-eabi/bin/objdump.exe differ
diff --git a/devkitARM/arm-none-eabi/bin/ranlib.exe b/devkitARM/arm-none-eabi/bin/ranlib.exe
index a62913d83..98fb9ae62 100644
Binary files a/devkitARM/arm-none-eabi/bin/ranlib.exe and b/devkitARM/arm-none-eabi/bin/ranlib.exe differ
diff --git a/devkitARM/arm-none-eabi/bin/readelf.exe b/devkitARM/arm-none-eabi/bin/readelf.exe
new file mode 100644
index 000000000..17a83a53f
Binary files /dev/null and b/devkitARM/arm-none-eabi/bin/readelf.exe differ
diff --git a/devkitARM/arm-none-eabi/bin/strip.exe b/devkitARM/arm-none-eabi/bin/strip.exe
index 3bd7534b4..cab8b72f9 100644
Binary files a/devkitARM/arm-none-eabi/bin/strip.exe and b/devkitARM/arm-none-eabi/bin/strip.exe differ
diff --git a/devkitARM/arm-none-eabi/include/_newlib_version.h b/devkitARM/arm-none-eabi/include/_newlib_version.h
new file mode 100644
index 000000000..73b527e6a
--- /dev/null
+++ b/devkitARM/arm-none-eabi/include/_newlib_version.h
@@ -0,0 +1,12 @@
+/* _newlib_version.h. Generated from _newlib_version.hin by configure. */
+/* Version macros for internal and downstream use. */
+#ifndef _NEWLIB_VERSION_H__
+#define _NEWLIB_VERSION_H__ 1
+
+#define _NEWLIB_VERSION "2.5.0"
+#define __NEWLIB__ 2
+#define __NEWLIB_MINOR__ 5
+#define __NEWLIB_PATCHLEVEL__ 0
+
+#endif /* !_NEWLIB_VERSION_H__ */
+
diff --git a/devkitARM/arm-none-eabi/include/c++/5.3.0/arm-none-eabi/armv6k/fpu/bits/atomic_word.h b/devkitARM/arm-none-eabi/include/c++/5.3.0/arm-none-eabi/armv6k/fpu/bits/atomic_word.h
deleted file mode 100644
index 19038bb6e..000000000
--- a/devkitARM/arm-none-eabi/include/c++/5.3.0/arm-none-eabi/armv6k/fpu/bits/atomic_word.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Low-level type for atomic operations -*- C++ -*-
-
-// Copyright (C) 2004-2015 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
-// .
-
-/** @file atomic_word.h
- * This file is a GNU extension to the Standard C++ Library.
- */
-
-#ifndef _GLIBCXX_ATOMIC_WORD_H
-#define _GLIBCXX_ATOMIC_WORD_H 1
-
-typedef int _Atomic_word;
-
-// Define these two macros using the appropriate memory barrier for the target.
-// The commented out versions below are the defaults.
-// See ia64/atomic_word.h for an alternative approach.
-
-// This one prevents loads from being hoisted across the barrier;
-// in other words, this is a Load-Load acquire barrier.
-// This is necessary iff TARGET_RELAXED_ORDERING is defined in tm.h.
-// #define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory")
-
-// This one prevents stores from being sunk across the barrier; in other
-// words, a Store-Store release barrier.
-// #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory")
-
-#endif
diff --git a/devkitARM/arm-none-eabi/include/c++/5.3.0/arm-none-eabi/bits/atomic_word.h b/devkitARM/arm-none-eabi/include/c++/5.3.0/arm-none-eabi/bits/atomic_word.h
deleted file mode 100644
index 19038bb6e..000000000
--- a/devkitARM/arm-none-eabi/include/c++/5.3.0/arm-none-eabi/bits/atomic_word.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Low-level type for atomic operations -*- C++ -*-
-
-// Copyright (C) 2004-2015 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
-// .
-
-/** @file atomic_word.h
- * This file is a GNU extension to the Standard C++ Library.
- */
-
-#ifndef _GLIBCXX_ATOMIC_WORD_H
-#define _GLIBCXX_ATOMIC_WORD_H 1
-
-typedef int _Atomic_word;
-
-// Define these two macros using the appropriate memory barrier for the target.
-// The commented out versions below are the defaults.
-// See ia64/atomic_word.h for an alternative approach.
-
-// This one prevents loads from being hoisted across the barrier;
-// in other words, this is a Load-Load acquire barrier.
-// This is necessary iff TARGET_RELAXED_ORDERING is defined in tm.h.
-// #define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory")
-
-// This one prevents stores from being sunk across the barrier; in other
-// words, a Store-Store release barrier.
-// #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory")
-
-#endif
diff --git a/devkitARM/arm-none-eabi/include/c++/5.3.0/arm-none-eabi/thumb/bits/atomic_word.h b/devkitARM/arm-none-eabi/include/c++/5.3.0/arm-none-eabi/thumb/bits/atomic_word.h
deleted file mode 100644
index 19038bb6e..000000000
--- a/devkitARM/arm-none-eabi/include/c++/5.3.0/arm-none-eabi/thumb/bits/atomic_word.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Low-level type for atomic operations -*- C++ -*-
-
-// Copyright (C) 2004-2015 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
-// .
-
-/** @file atomic_word.h
- * This file is a GNU extension to the Standard C++ Library.
- */
-
-#ifndef _GLIBCXX_ATOMIC_WORD_H
-#define _GLIBCXX_ATOMIC_WORD_H 1
-
-typedef int _Atomic_word;
-
-// Define these two macros using the appropriate memory barrier for the target.
-// The commented out versions below are the defaults.
-// See ia64/atomic_word.h for an alternative approach.
-
-// This one prevents loads from being hoisted across the barrier;
-// in other words, this is a Load-Load acquire barrier.
-// This is necessary iff TARGET_RELAXED_ORDERING is defined in tm.h.
-// #define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory")
-
-// This one prevents stores from being sunk across the barrier; in other
-// words, a Store-Store release barrier.
-// #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory")
-
-#endif
diff --git a/devkitARM/arm-none-eabi/include/c++/5.3.0/bits/ptr_traits.h b/devkitARM/arm-none-eabi/include/c++/5.3.0/bits/ptr_traits.h
deleted file mode 100644
index 9fd6bf866..000000000
--- a/devkitARM/arm-none-eabi/include/c++/5.3.0/bits/ptr_traits.h
+++ /dev/null
@@ -1,177 +0,0 @@
-// Pointer Traits -*- C++ -*-
-
-// Copyright (C) 2011-2015 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
-// .
-
-/** @file bits/ptr_traits.h
- * This is an internal header file, included by other library headers.
- * Do not attempt to use it directly. @headername{memory}
- */
-
-#ifndef _PTR_TRAITS_H
-#define _PTR_TRAITS_H 1
-
-#if __cplusplus >= 201103L
-
-#include // For _GLIBCXX_HAS_NESTED_TYPE
-
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
-_GLIBCXX_HAS_NESTED_TYPE(element_type)
-_GLIBCXX_HAS_NESTED_TYPE(difference_type)
-
- template::value>
- struct __ptrtr_elt_type;
-
- template
- struct __ptrtr_elt_type<_Tp, true>
- {
- typedef typename _Tp::element_type __type;
- };
-
- template class _SomePtr, typename _Tp,
- typename... _Args>
- struct __ptrtr_elt_type<_SomePtr<_Tp, _Args...>, false>
- {
- typedef _Tp __type;
- };
-
- template::value>
- struct __ptrtr_diff_type
- {
- typedef typename _Tp::difference_type __type;
- };
-
- template
- struct __ptrtr_diff_type<_Tp, false>
- {
- typedef ptrdiff_t __type;
- };
-
- template
- class __ptrtr_rebind_helper
- {
- template
- static constexpr true_type
- _S_chk(typename _Ptr2::template rebind<_Up2>*);
-
- template
- static constexpr false_type
- _S_chk(...);
-
- public:
- using __type = decltype(_S_chk<_Ptr, _Up>(nullptr));
- };
-
- template::__type::value>
- struct __ptrtr_rebind;
-
- template
- struct __ptrtr_rebind<_Tp, _Up, true>
- {
- typedef typename _Tp::template rebind<_Up> __type;
- };
-
- template class _SomePtr, typename _Up,
- typename _Tp, typename... _Args>
- struct __ptrtr_rebind<_SomePtr<_Tp, _Args...>, _Up, false>
- {
- typedef _SomePtr<_Up, _Args...> __type;
- };
-
- template::type>
- struct __ptrtr_not_void
- {
- typedef _Tp __type;
- };
-
- template
- struct __ptrtr_not_void<_Tp, void>
- {
- struct __type { };
- };
-
- template
- class __ptrtr_pointer_to
- {
- typedef typename __ptrtr_elt_type<_Ptr>::__type __orig_type;
- typedef typename __ptrtr_not_void<__orig_type>::__type __element_type;
-
- public:
- static _Ptr pointer_to(__element_type& __e)
- { return _Ptr::pointer_to(__e); }
- };
-
- /**
- * @brief Uniform interface to all pointer-like types
- * @ingroup pointer_abstractions
- */
- template
- struct pointer_traits : __ptrtr_pointer_to<_Ptr>
- {
- /// The pointer type
- typedef _Ptr pointer;
- /// The type pointed to
- typedef typename __ptrtr_elt_type<_Ptr>::__type element_type;
- /// Type used to represent the difference between two pointers
- typedef typename __ptrtr_diff_type<_Ptr>::__type difference_type;
-
- template
- using rebind = typename __ptrtr_rebind<_Ptr, _Up>::__type;
- };
-
- /**
- * @brief Partial specialization for built-in pointers.
- * @ingroup pointer_abstractions
- */
- template
- struct pointer_traits<_Tp*>
- {
- /// The pointer type
- typedef _Tp* pointer;
- /// The type pointed to
- typedef _Tp element_type;
- /// Type used to represent the difference between two pointers
- typedef ptrdiff_t difference_type;
-
- template
- using rebind = _Up*;
-
- /**
- * @brief Obtain a pointer to an object
- * @param __r A reference to an object of type @c element_type
- * @return @c addressof(__r)
- */
- static pointer
- pointer_to(typename __ptrtr_not_void::__type& __r) noexcept
- { return std::addressof(__r); }
- };
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace std
-
-#endif
-
-#endif
diff --git a/devkitARM/arm-none-eabi/include/c++/5.3.0/bits/regex_executor.tcc b/devkitARM/arm-none-eabi/include/c++/5.3.0/bits/regex_executor.tcc
deleted file mode 100644
index f06549964..000000000
--- a/devkitARM/arm-none-eabi/include/c++/5.3.0/bits/regex_executor.tcc
+++ /dev/null
@@ -1,436 +0,0 @@
-// class template regex -*- C++ -*-
-
-// Copyright (C) 2013-2015 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
-// .
-
-/**
- * @file bits/regex_executor.tcc
- * This is an internal header file, included by other library headers.
- * Do not attempt to use it directly. @headername{regex}
- */
-
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-namespace __detail
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- template
- bool _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>::
- _M_search()
- {
- if (_M_search_from_first())
- return true;
- if (_M_flags & regex_constants::match_continuous)
- return false;
- _M_flags |= regex_constants::match_prev_avail;
- while (_M_begin != _M_end)
- {
- ++_M_begin;
- if (_M_search_from_first())
- return true;
- }
- return false;
- }
-
- // The _M_main function operates in different modes, DFS mode or BFS mode,
- // indicated by template parameter __dfs_mode, and dispatches to one of the
- // _M_main_dispatch overloads.
- //
- // ------------------------------------------------------------
- //
- // DFS mode:
- //
- // It applies a Depth-First-Search (aka backtracking) on given NFA and input
- // string.
- // At the very beginning the executor stands in the start state, then it
- // tries every possible state transition in current state recursively. Some
- // state transitions consume input string, say, a single-char-matcher or a
- // back-reference matcher; some don't, like assertion or other anchor nodes.
- // When the input is exhausted and/or the current state is an accepting
- // state, the whole executor returns true.
- //
- // TODO: This approach is exponentially slow for certain input.
- // Try to compile the NFA to a DFA.
- //
- // Time complexity: \Omega(match_length), O(2^(_M_nfa.size()))
- // Space complexity: \theta(match_results.size() + match_length)
- //
- template
- bool _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>::
- _M_main_dispatch(_Match_mode __match_mode, __dfs)
- {
- _M_has_sol = false;
- *_M_states._M_get_sol_pos() = _BiIter();
- _M_cur_results = _M_results;
- _M_dfs(__match_mode, _M_states._M_start);
- return _M_has_sol;
- }
-
- // ------------------------------------------------------------
- //
- // BFS mode:
- //
- // Russ Cox's article (http://swtch.com/~rsc/regexp/regexp1.html)
- // explained this algorithm clearly.
- //
- // It first computes epsilon closure (states that can be achieved without
- // consuming characters) for every state that's still matching,
- // using the same DFS algorithm, but doesn't re-enter states (using
- // _M_states._M_visited to check), nor follow _S_opcode_match.
- //
- // Then apply DFS using every _S_opcode_match (in _M_states._M_match_queue)
- // as the start state.
- //
- // It significantly reduces potential duplicate states, so has a better
- // upper bound; but it requires more overhead.
- //
- // Time complexity: \Omega(match_length * match_results.size())
- // O(match_length * _M_nfa.size() * match_results.size())
- // Space complexity: \Omega(_M_nfa.size() + match_results.size())
- // O(_M_nfa.size() * match_results.size())
- template
- bool _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>::
- _M_main_dispatch(_Match_mode __match_mode, __bfs)
- {
- _M_states._M_queue(_M_states._M_start, _M_results);
- bool __ret = false;
- while (1)
- {
- _M_has_sol = false;
- if (_M_states._M_match_queue.empty())
- break;
- std::fill_n(_M_states._M_visited_states.get(), _M_nfa.size(), false);
- auto __old_queue = std::move(_M_states._M_match_queue);
- for (auto& __task : __old_queue)
- {
- _M_cur_results = std::move(__task.second);
- _M_dfs(__match_mode, __task.first);
- }
- if (__match_mode == _Match_mode::_Prefix)
- __ret |= _M_has_sol;
- if (_M_current == _M_end)
- break;
- ++_M_current;
- }
- if (__match_mode == _Match_mode::_Exact)
- __ret = _M_has_sol;
- _M_states._M_match_queue.clear();
- return __ret;
- }
-
- // Return whether now match the given sub-NFA.
- template
- bool _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>::
- _M_lookahead(_State<_TraitsT> __state)
- {
- _ResultsVec __what(_M_cur_results.size());
- _Executor __sub(_M_current, _M_end, __what, _M_re, _M_flags);
- __sub._M_states._M_start = __state._M_alt;
- if (__sub._M_search_from_first())
- {
- for (size_t __i = 0; __i < __what.size(); __i++)
- if (__what[__i].matched)
- _M_cur_results[__i] = __what[__i];
- return true;
- }
- return false;
- }
-
- // __rep_count records how many times (__rep_count.second)
- // this node is visited under certain input iterator
- // (__rep_count.first). This prevent the executor from entering
- // infinite loop by refusing to continue when it's already been
- // visited more than twice. It's `twice` instead of `once` because
- // we need to spare one more time for potential group capture.
- template
- void _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>::
- _M_rep_once_more(_Match_mode __match_mode, _StateIdT __i)
- {
- const auto& __state = _M_nfa[__i];
- auto& __rep_count = _M_rep_count[__i];
- if (__rep_count.second == 0 || __rep_count.first != _M_current)
- {
- auto __back = __rep_count;
- __rep_count.first = _M_current;
- __rep_count.second = 1;
- _M_dfs(__match_mode, __state._M_alt);
- __rep_count = __back;
- }
- else
- {
- if (__rep_count.second < 2)
- {
- __rep_count.second++;
- _M_dfs(__match_mode, __state._M_alt);
- __rep_count.second--;
- }
- }
- };
-
- template
- void _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>::
- _M_dfs(_Match_mode __match_mode, _StateIdT __i)
- {
- if (_M_states._M_visited(__i))
- return;
-
- const auto& __state = _M_nfa[__i];
- // Every change on _M_cur_results and _M_current will be rolled back after
- // finishing the recursion step.
- switch (__state._M_opcode)
- {
- // _M_alt branch is "match once more", while _M_next is "get me out
- // of this quantifier". Executing _M_next first or _M_alt first don't
- // mean the same thing, and we need to choose the correct order under
- // given greedy mode.
- case _S_opcode_repeat:
- {
- // Greedy.
- if (!__state._M_neg)
- {
- _M_rep_once_more(__match_mode, __i);
- // If it's DFS executor and already accepted, we're done.
- if (!__dfs_mode || !_M_has_sol)
- _M_dfs(__match_mode, __state._M_next);
- }
- else // Non-greedy mode
- {
- if (__dfs_mode)
- {
- // vice-versa.
- _M_dfs(__match_mode, __state._M_next);
- if (!_M_has_sol)
- _M_rep_once_more(__match_mode, __i);
- }
- else
- {
- // DON'T attempt anything, because there's already another
- // state with higher priority accepted. This state cannot
- // be better by attempting its next node.
- if (!_M_has_sol)
- {
- _M_dfs(__match_mode, __state._M_next);
- // DON'T attempt anything if it's already accepted. An
- // accepted state *must* be better than a solution that
- // matches a non-greedy quantifier one more time.
- if (!_M_has_sol)
- _M_rep_once_more(__match_mode, __i);
- }
- }
- }
- }
- break;
- case _S_opcode_subexpr_begin:
- {
- auto& __res = _M_cur_results[__state._M_subexpr];
- auto __back = __res.first;
- __res.first = _M_current;
- _M_dfs(__match_mode, __state._M_next);
- __res.first = __back;
- }
- break;
- case _S_opcode_subexpr_end:
- {
- auto& __res = _M_cur_results[__state._M_subexpr];
- auto __back = __res;
- __res.second = _M_current;
- __res.matched = true;
- _M_dfs(__match_mode, __state._M_next);
- __res = __back;
- }
- break;
- case _S_opcode_line_begin_assertion:
- if (_M_at_begin())
- _M_dfs(__match_mode, __state._M_next);
- break;
- case _S_opcode_line_end_assertion:
- if (_M_at_end())
- _M_dfs(__match_mode, __state._M_next);
- break;
- case _S_opcode_word_boundary:
- if (_M_word_boundary() == !__state._M_neg)
- _M_dfs(__match_mode, __state._M_next);
- break;
- // Here __state._M_alt offers a single start node for a sub-NFA.
- // We recursively invoke our algorithm to match the sub-NFA.
- case _S_opcode_subexpr_lookahead:
- if (_M_lookahead(__state) == !__state._M_neg)
- _M_dfs(__match_mode, __state._M_next);
- break;
- case _S_opcode_match:
- if (_M_current == _M_end)
- break;
- if (__dfs_mode)
- {
- if (__state._M_matches(*_M_current))
- {
- ++_M_current;
- _M_dfs(__match_mode, __state._M_next);
- --_M_current;
- }
- }
- else
- if (__state._M_matches(*_M_current))
- _M_states._M_queue(__state._M_next, _M_cur_results);
- break;
- // First fetch the matched result from _M_cur_results as __submatch;
- // then compare it with
- // (_M_current, _M_current + (__submatch.second - __submatch.first)).
- // If matched, keep going; else just return and try another state.
- case _S_opcode_backref:
- {
- _GLIBCXX_DEBUG_ASSERT(__dfs_mode);
- auto& __submatch = _M_cur_results[__state._M_backref_index];
- if (!__submatch.matched)
- break;
- auto __last = _M_current;
- for (auto __tmp = __submatch.first;
- __last != _M_end && __tmp != __submatch.second;
- ++__tmp)
- ++__last;
- if (_M_re._M_automaton->_M_traits.transform(__submatch.first,
- __submatch.second)
- == _M_re._M_automaton->_M_traits.transform(_M_current, __last))
- {
- if (__last != _M_current)
- {
- auto __backup = _M_current;
- _M_current = __last;
- _M_dfs(__match_mode, __state._M_next);
- _M_current = __backup;
- }
- else
- _M_dfs(__match_mode, __state._M_next);
- }
- }
- break;
- case _S_opcode_accept:
- if (__dfs_mode)
- {
- _GLIBCXX_DEBUG_ASSERT(!_M_has_sol);
- if (__match_mode == _Match_mode::_Exact)
- _M_has_sol = _M_current == _M_end;
- else
- _M_has_sol = true;
- if (_M_current == _M_begin
- && (_M_flags & regex_constants::match_not_null))
- _M_has_sol = false;
- if (_M_has_sol)
- {
- if (_M_nfa._M_flags & regex_constants::ECMAScript)
- _M_results = _M_cur_results;
- else // POSIX
- {
- _GLIBCXX_DEBUG_ASSERT(_M_states._M_get_sol_pos());
- // Here's POSIX's logic: match the longest one. However
- // we never know which one (lhs or rhs of "|") is longer
- // unless we try both of them and compare the results.
- // The member variable _M_sol_pos records the end
- // position of the last successful match. It's better
- // to be larger, because POSIX regex is always greedy.
- // TODO: This could be slow.
- if (*_M_states._M_get_sol_pos() == _BiIter()
- || std::distance(_M_begin,
- *_M_states._M_get_sol_pos())
- < std::distance(_M_begin, _M_current))
- {
- *_M_states._M_get_sol_pos() = _M_current;
- _M_results = _M_cur_results;
- }
- }
- }
- }
- else
- {
- if (_M_current == _M_begin
- && (_M_flags & regex_constants::match_not_null))
- break;
- if (__match_mode == _Match_mode::_Prefix || _M_current == _M_end)
- if (!_M_has_sol)
- {
- _M_has_sol = true;
- _M_results = _M_cur_results;
- }
- }
- break;
- case _S_opcode_alternative:
- if (_M_nfa._M_flags & regex_constants::ECMAScript)
- {
- // TODO: Let BFS support ECMAScript's alternative operation.
- _GLIBCXX_DEBUG_ASSERT(__dfs_mode);
- _M_dfs(__match_mode, __state._M_alt);
- // Pick lhs if it matches. Only try rhs if it doesn't.
- if (!_M_has_sol)
- _M_dfs(__match_mode, __state._M_next);
- }
- else
- {
- // Try both and compare the result.
- // See "case _S_opcode_accept:" handling above.
- _M_dfs(__match_mode, __state._M_alt);
- auto __has_sol = _M_has_sol;
- _M_has_sol = false;
- _M_dfs(__match_mode, __state._M_next);
- _M_has_sol |= __has_sol;
- }
- break;
- default:
- _GLIBCXX_DEBUG_ASSERT(false);
- }
- }
-
- // Return whether now is at some word boundary.
- template
- bool _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>::
- _M_word_boundary() const
- {
- bool __left_is_word = false;
- if (_M_current != _M_begin
- || (_M_flags & regex_constants::match_prev_avail))
- {
- auto __prev = _M_current;
- if (_M_is_word(*std::prev(__prev)))
- __left_is_word = true;
- }
- bool __right_is_word =
- _M_current != _M_end && _M_is_word(*_M_current);
-
- if (__left_is_word == __right_is_word)
- return false;
- if (__left_is_word && !(_M_flags & regex_constants::match_not_eow))
- return true;
- if (__right_is_word && !(_M_flags & regex_constants::match_not_bow))
- return true;
- return false;
- }
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace __detail
-} // namespace
diff --git a/devkitARM/arm-none-eabi/include/c++/5.3.0/bits/stl_pair.h b/devkitARM/arm-none-eabi/include/c++/5.3.0/bits/stl_pair.h
deleted file mode 100644
index 3daeb60ab..000000000
--- a/devkitARM/arm-none-eabi/include/c++/5.3.0/bits/stl_pair.h
+++ /dev/null
@@ -1,295 +0,0 @@
-// Pair implementation -*- C++ -*-
-
-// Copyright (C) 2001-2015 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
-// .
-
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996,1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- */
-
-/** @file bits/stl_pair.h
- * This is an internal header file, included by other library headers.
- * Do not attempt to use it directly. @headername{utility}
- */
-
-#ifndef _STL_PAIR_H
-#define _STL_PAIR_H 1
-
-#include // for std::move / std::forward, and std::swap
-
-#if __cplusplus >= 201103L
-#include // for std::__decay_and_strip too
-#endif
-
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- /**
- * @addtogroup utilities
- * @{
- */
-
-#if __cplusplus >= 201103L
- /// piecewise_construct_t
- struct piecewise_construct_t { };
-
- /// piecewise_construct
- constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
-
- // Forward declarations.
- template
- class tuple;
-
- template
- struct _Index_tuple;
-#endif
-
- /**
- * @brief Struct holding two objects of arbitrary type.
- *
- * @tparam _T1 Type of first object.
- * @tparam _T2 Type of second object.
- */
- template
- struct pair
- {
- typedef _T1 first_type; /// @c first_type is the first bound type
- typedef _T2 second_type; /// @c second_type is the second bound type
-
- _T1 first; /// @c first is a copy of the first object
- _T2 second; /// @c second is a copy of the second object
-
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 265. std::pair::pair() effects overly restrictive
- /** The default constructor creates @c first and @c second using their
- * respective default constructors. */
- _GLIBCXX_CONSTEXPR pair()
- : first(), second() { }
-
- /** Two objects may be passed to a @c pair constructor to be copied. */
- _GLIBCXX_CONSTEXPR pair(const _T1& __a, const _T2& __b)
- : first(__a), second(__b) { }
-
- /** There is also a templated copy ctor for the @c pair class itself. */
-#if __cplusplus < 201103L
- template
- pair(const pair<_U1, _U2>& __p)
- : first(__p.first), second(__p.second) { }
-#else
- template,
- is_convertible>::value>::type>
- constexpr pair(const pair<_U1, _U2>& __p)
- : first(__p.first), second(__p.second) { }
-
- constexpr pair(const pair&) = default;
- constexpr pair(pair&&) = default;
-
- // DR 811.
- template::value>::type>
- constexpr pair(_U1&& __x, const _T2& __y)
- : first(std::forward<_U1>(__x)), second(__y) { }
-
- template::value>::type>
- constexpr pair(const _T1& __x, _U2&& __y)
- : first(__x), second(std::forward<_U2>(__y)) { }
-
- template,
- is_convertible<_U2, _T2>>::value>::type>
- constexpr pair(_U1&& __x, _U2&& __y)
- : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
-
- template,
- is_convertible<_U2, _T2>>::value>::type>
- constexpr pair(pair<_U1, _U2>&& __p)
- : first(std::forward<_U1>(__p.first)),
- second(std::forward<_U2>(__p.second)) { }
-
- template
- pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>);
-
- pair&
- operator=(const pair& __p)
- {
- first = __p.first;
- second = __p.second;
- return *this;
- }
-
- pair&
- operator=(pair&& __p)
- noexcept(__and_,
- is_nothrow_move_assignable<_T2>>::value)
- {
- first = std::forward(__p.first);
- second = std::forward(__p.second);
- return *this;
- }
-
- template
- pair&
- operator=(const pair<_U1, _U2>& __p)
- {
- first = __p.first;
- second = __p.second;
- return *this;
- }
-
- template
- pair&
- operator=(pair<_U1, _U2>&& __p)
- {
- first = std::forward<_U1>(__p.first);
- second = std::forward<_U2>(__p.second);
- return *this;
- }
-
- void
- swap(pair& __p)
- noexcept(noexcept(swap(first, __p.first))
- && noexcept(swap(second, __p.second)))
- {
- using std::swap;
- swap(first, __p.first);
- swap(second, __p.second);
- }
-
- private:
- template
- pair(tuple<_Args1...>&, tuple<_Args2...>&,
- _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
-#endif
- };
-
- /// Two pairs of the same type are equal iff their members are equal.
- template
- inline _GLIBCXX_CONSTEXPR bool
- operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
- { return __x.first == __y.first && __x.second == __y.second; }
-
- ///
- template
- inline _GLIBCXX_CONSTEXPR bool
- operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
- { return __x.first < __y.first
- || (!(__y.first < __x.first) && __x.second < __y.second); }
-
- /// Uses @c operator== to find the result.
- template
- inline _GLIBCXX_CONSTEXPR bool
- operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
- { return !(__x == __y); }
-
- /// Uses @c operator< to find the result.
- template
- inline _GLIBCXX_CONSTEXPR bool
- operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
- { return __y < __x; }
-
- /// Uses @c operator< to find the result.
- template
- inline _GLIBCXX_CONSTEXPR bool
- operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
- { return !(__y < __x); }
-
- /// Uses @c operator< to find the result.
- template
- inline _GLIBCXX_CONSTEXPR bool
- operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
- { return !(__x < __y); }
-
-#if __cplusplus >= 201103L
- /// See std::pair::swap().
- // Note: no std::swap overloads in C++03 mode, this has performance
- // implications, see, eg, libstdc++/38466.
- template
- inline void
- swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
- noexcept(noexcept(__x.swap(__y)))
- { __x.swap(__y); }
-#endif
-
- /**
- * @brief A convenience wrapper for creating a pair from two objects.
- * @param __x The first object.
- * @param __y The second object.
- * @return A newly-constructed pair<> object of the appropriate type.
- *
- * The standard requires that the objects be passed by reference-to-const,
- * but LWG issue #181 says they should be passed by const value. We follow
- * the LWG by default.
- */
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 181. make_pair() unintended behavior
-#if __cplusplus >= 201103L
- // NB: DR 706.
- template
- constexpr pair::__type,
- typename __decay_and_strip<_T2>::__type>
- make_pair(_T1&& __x, _T2&& __y)
- {
- typedef typename __decay_and_strip<_T1>::__type __ds_type1;
- typedef typename __decay_and_strip<_T2>::__type __ds_type2;
- typedef pair<__ds_type1, __ds_type2> __pair_type;
- return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y));
- }
-#else
- template
- inline pair<_T1, _T2>
- make_pair(_T1 __x, _T2 __y)
- { return pair<_T1, _T2>(__x, __y); }
-#endif
-
- /// @}
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace std
-
-#endif /* _STL_PAIR_H */
diff --git a/devkitARM/arm-none-eabi/include/c++/5.3.0/bits/uses_allocator.h b/devkitARM/arm-none-eabi/include/c++/5.3.0/bits/uses_allocator.h
deleted file mode 100644
index f9ea7d68e..000000000
--- a/devkitARM/arm-none-eabi/include/c++/5.3.0/bits/uses_allocator.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// Uses-allocator Construction -*- C++ -*-
-
-// Copyright (C) 2010-2015 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
-// .
-
-#ifndef _USES_ALLOCATOR_H
-#define _USES_ALLOCATOR_H 1
-
-#if __cplusplus < 201103L
-# include
-#else
-
-#include
-
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- /// [allocator.tag]
- struct allocator_arg_t { };
-
- constexpr allocator_arg_t allocator_arg = allocator_arg_t();
-
- template>
- struct __uses_allocator_helper
- : false_type { };
-
- template
- struct __uses_allocator_helper<_Tp, _Alloc,
- __void_t>
- : is_convertible<_Alloc, typename _Tp::allocator_type>::type
- { };
-
- /// [allocator.uses.trait]
- template
- struct uses_allocator
- : __uses_allocator_helper<_Tp, _Alloc>::type
- { };
-
- struct __uses_alloc_base { };
-
- struct __uses_alloc0 : __uses_alloc_base
- {
- struct _Sink { void operator=(const void*) { } } _M_a;
- };
-
- template
- struct __uses_alloc1 : __uses_alloc_base { const _Alloc* _M_a; };
-
- template
- struct __uses_alloc2 : __uses_alloc_base { const _Alloc* _M_a; };
-
- template
- struct __uses_alloc;
-
- template
- struct __uses_alloc
- : conditional<
- is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value,
- __uses_alloc1<_Alloc>,
- __uses_alloc2<_Alloc>>::type
- { };
-
- template
- struct __uses_alloc
- : __uses_alloc0 { };
-
- template
- using __uses_alloc_t =
- __uses_alloc::value, _Tp, _Alloc, _Args...>;
-
- template
- inline __uses_alloc_t<_Tp, _Alloc, _Args...>
- __use_alloc(const _Alloc& __a)
- {
- __uses_alloc_t<_Tp, _Alloc, _Args...> __ret;
- __ret._M_a = &__a;
- return __ret;
- }
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace std
-
-#endif
-#endif
diff --git a/devkitARM/arm-none-eabi/include/c++/5.3.0/functional b/devkitARM/arm-none-eabi/include/c++/5.3.0/functional
deleted file mode 100644
index e9d48e408..000000000
--- a/devkitARM/arm-none-eabi/include/c++/5.3.0/functional
+++ /dev/null
@@ -1,2381 +0,0 @@
-// -*- C++ -*-
-
-// Copyright (C) 2001-2015 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
-// .
-
-/*
- * Copyright (c) 1997
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-/** @file include/functional
- * This is a Standard C++ Library header.
- */
-
-#ifndef _GLIBCXX_FUNCTIONAL
-#define _GLIBCXX_FUNCTIONAL 1
-
-#pragma GCC system_header
-
-#include
-#include
-
-#if __cplusplus >= 201103L
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- template
- class _Mem_fn;
- template
- _Mem_fn<_Tp _Class::*>
- mem_fn(_Tp _Class::*) noexcept;
-
- /// If we have found a result_type, extract it.
- template>
- struct _Maybe_get_result_type
- { };
-
- template
- struct _Maybe_get_result_type<_Functor,
- __void_t>
- { typedef typename _Functor::result_type result_type; };
-
- /**
- * Base class for any function object that has a weak result type, as
- * defined in 20.8.2 [func.require] of C++11.
- */
- template
- struct _Weak_result_type_impl
- : _Maybe_get_result_type<_Functor>
- { };
-
- /// Retrieve the result type for a function type.
- template
- struct _Weak_result_type_impl<_Res(_ArgTypes...)>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res(_ArgTypes......)>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res(_ArgTypes...) const>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res(_ArgTypes......) const>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res(_ArgTypes...) volatile>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res(_ArgTypes......) volatile>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res(_ArgTypes...) const volatile>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res(_ArgTypes......) const volatile>
- { typedef _Res result_type; };
-
- /// Retrieve the result type for a function reference.
- template
- struct _Weak_result_type_impl<_Res(&)(_ArgTypes...)>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res(&)(_ArgTypes......)>
- { typedef _Res result_type; };
-
- /// Retrieve the result type for a function pointer.
- template
- struct _Weak_result_type_impl<_Res(*)(_ArgTypes...)>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res(*)(_ArgTypes......)>
- { typedef _Res result_type; };
-
- /// Retrieve result type for a member function pointer.
- template
- struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...)>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......)>
- { typedef _Res result_type; };
-
- /// Retrieve result type for a const member function pointer.
- template
- struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) const>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......) const>
- { typedef _Res result_type; };
-
- /// Retrieve result type for a volatile member function pointer.
- template
- struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) volatile>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......) volatile>
- { typedef _Res result_type; };
-
- /// Retrieve result type for a const volatile member function pointer.
- template
- struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...)
- const volatile>
- { typedef _Res result_type; };
-
- template
- struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......)
- const volatile>
- { typedef _Res result_type; };
-
- /**
- * Strip top-level cv-qualifiers from the function object and let
- * _Weak_result_type_impl perform the real work.
- */
- template
- struct _Weak_result_type
- : _Weak_result_type_impl::type>
- { };
-
- /**
- * Invoke a function object, which may be either a member pointer or a
- * function object. The first parameter will tell which.
- */
- template
- inline
- typename enable_if<
- (!is_member_pointer<_Functor>::value
- && !is_function<_Functor>::value
- && !is_function::type>::value),
- typename result_of<_Functor&(_Args&&...)>::type
- >::type
- __invoke(_Functor& __f, _Args&&... __args)
- {
- return __f(std::forward<_Args>(__args)...);
- }
-
- template
- inline
- typename enable_if<
- (is_member_pointer<_Functor>::value
- && !is_function<_Functor>::value
- && !is_function::type>::value),
- typename result_of<_Functor(_Args&&...)>::type
- >::type
- __invoke(_Functor& __f, _Args&&... __args)
- {
- return std::mem_fn(__f)(std::forward<_Args>(__args)...);
- }
-
- // To pick up function references (that will become function pointers)
- template
- inline
- typename enable_if<
- (is_pointer<_Functor>::value
- && is_function::type>::value),
- typename result_of<_Functor(_Args&&...)>::type
- >::type
- __invoke(_Functor __f, _Args&&... __args)
- {
- return __f(std::forward<_Args>(__args)...);
- }
-
- /**
- * Knowing which of unary_function and binary_function _Tp derives
- * from, derives from the same and ensures that reference_wrapper
- * will have a weak result type. See cases below.
- */
- template
- struct _Reference_wrapper_base_impl;
-
- // None of the nested argument types.
- template
- struct _Reference_wrapper_base_impl
- : _Weak_result_type<_Tp>
- { };
-
- // Nested argument_type only.
- template
- struct _Reference_wrapper_base_impl
- : _Weak_result_type<_Tp>
- {
- typedef typename _Tp::argument_type argument_type;
- };
-
- // Nested first_argument_type and second_argument_type only.
- template
- struct _Reference_wrapper_base_impl
- : _Weak_result_type<_Tp>
- {
- typedef typename _Tp::first_argument_type first_argument_type;
- typedef typename _Tp::second_argument_type second_argument_type;
- };
-
- // All the nested argument types.
- template
- struct _Reference_wrapper_base_impl
- : _Weak_result_type<_Tp>
- {
- typedef typename _Tp::argument_type argument_type;
- typedef typename _Tp::first_argument_type first_argument_type;
- typedef typename _Tp::second_argument_type second_argument_type;
- };
-
- _GLIBCXX_HAS_NESTED_TYPE(argument_type)
- _GLIBCXX_HAS_NESTED_TYPE(first_argument_type)
- _GLIBCXX_HAS_NESTED_TYPE(second_argument_type)
-
- /**
- * Derives from unary_function or binary_function when it
- * can. Specializations handle all of the easy cases. The primary
- * template determines what to do with a class type, which may
- * derive from both unary_function and binary_function.
- */
- template
- struct _Reference_wrapper_base
- : _Reference_wrapper_base_impl<
- __has_argument_type<_Tp>::value,
- __has_first_argument_type<_Tp>::value
- && __has_second_argument_type<_Tp>::value,
- _Tp>
- { };
-
- // - a function type (unary)
- template
- struct _Reference_wrapper_base<_Res(_T1)>
- : unary_function<_T1, _Res>
- { };
-
- template
- struct _Reference_wrapper_base<_Res(_T1) const>
- : unary_function<_T1, _Res>
- { };
-
- template
- struct _Reference_wrapper_base<_Res(_T1) volatile>
- : unary_function<_T1, _Res>
- { };
-
- template
- struct _Reference_wrapper_base<_Res(_T1) const volatile>
- : unary_function<_T1, _Res>
- { };
-
- // - a function type (binary)
- template
- struct _Reference_wrapper_base<_Res(_T1, _T2)>
- : binary_function<_T1, _T2, _Res>
- { };
-
- template
- struct _Reference_wrapper_base<_Res(_T1, _T2) const>
- : binary_function<_T1, _T2, _Res>
- { };
-
- template
- struct _Reference_wrapper_base<_Res(_T1, _T2) volatile>
- : binary_function<_T1, _T2, _Res>
- { };
-
- template
- struct _Reference_wrapper_base<_Res(_T1, _T2) const volatile>
- : binary_function<_T1, _T2, _Res>
- { };
-
- // - a function pointer type (unary)
- template
- struct _Reference_wrapper_base<_Res(*)(_T1)>
- : unary_function<_T1, _Res>
- { };
-
- // - a function pointer type (binary)
- template
- struct _Reference_wrapper_base<_Res(*)(_T1, _T2)>
- : binary_function<_T1, _T2, _Res>
- { };
-
- // - a pointer to member function type (unary, no qualifiers)
- template
- struct _Reference_wrapper_base<_Res (_T1::*)()>
- : unary_function<_T1*, _Res>
- { };
-
- // - a pointer to member function type (binary, no qualifiers)
- template
- struct _Reference_wrapper_base<_Res (_T1::*)(_T2)>
- : binary_function<_T1*, _T2, _Res>
- { };
-
- // - a pointer to member function type (unary, const)
- template
- struct _Reference_wrapper_base<_Res (_T1::*)() const>
- : unary_function
- { };
-
- // - a pointer to member function type (binary, const)
- template
- struct _Reference_wrapper_base<_Res (_T1::*)(_T2) const>
- : binary_function
- { };
-
- // - a pointer to member function type (unary, volatile)
- template
- struct _Reference_wrapper_base<_Res (_T1::*)() volatile>
- : unary_function
- { };
-
- // - a pointer to member function type (binary, volatile)
- template
- struct _Reference_wrapper_base<_Res (_T1::*)(_T2) volatile>
- : binary_function
- { };
-
- // - a pointer to member function type (unary, const volatile)
- template
- struct _Reference_wrapper_base<_Res (_T1::*)() const volatile>
- : unary_function
- { };
-
- // - a pointer to member function type (binary, const volatile)
- template
- struct _Reference_wrapper_base<_Res (_T1::*)(_T2) const volatile>
- : binary_function
- { };
-
- /**
- * @brief Primary class template for reference_wrapper.
- * @ingroup functors
- * @{
- */
- template
- class reference_wrapper
- : public _Reference_wrapper_base::type>
- {
- _Tp* _M_data;
-
- public:
- typedef _Tp type;
-
- reference_wrapper(_Tp& __indata) noexcept
- : _M_data(std::__addressof(__indata))
- { }
-
- reference_wrapper(_Tp&&) = delete;
-
- reference_wrapper(const reference_wrapper&) = default;
-
- reference_wrapper&
- operator=(const reference_wrapper&) = default;
-
- operator _Tp&() const noexcept
- { return this->get(); }
-
- _Tp&
- get() const noexcept
- { return *_M_data; }
-
- template
- typename result_of<_Tp&(_Args&&...)>::type
- operator()(_Args&&... __args) const
- {
- return __invoke(get(), std::forward<_Args>(__args)...);
- }
- };
-
-
- /// Denotes a reference should be taken to a variable.
- template
- inline reference_wrapper<_Tp>
- ref(_Tp& __t) noexcept
- { return reference_wrapper<_Tp>(__t); }
-
- /// Denotes a const reference should be taken to a variable.
- template
- inline reference_wrapper
- cref(const _Tp& __t) noexcept
- { return reference_wrapper(__t); }
-
- template
- void ref(const _Tp&&) = delete;
-
- template
- void cref(const _Tp&&) = delete;
-
- /// Partial specialization.
- template
- inline reference_wrapper<_Tp>
- ref(reference_wrapper<_Tp> __t) noexcept
- { return ref(__t.get()); }
-
- /// Partial specialization.
- template
- inline reference_wrapper
- cref(reference_wrapper<_Tp> __t) noexcept
- { return cref(__t.get()); }
-
- // @} group functors
-
- template
- struct _Pack : integral_constant
- { };
-
- template
- struct _AllConvertible : false_type
- { };
-
- template
- struct _AllConvertible<_Pack<_From...>, _Pack<_To...>, true>
- : __and_...>
- { };
-
- template
- using _NotSame = __not_::type,
- typename std::decay<_Tp2>::type>>;
-
- /**
- * Derives from @c unary_function or @c binary_function, or perhaps
- * nothing, depending on the number of arguments provided. The
- * primary template is the basis case, which derives nothing.
- */
- template
- struct _Maybe_unary_or_binary_function { };
-
- /// Derives from @c unary_function, as appropriate.
- template
- struct _Maybe_unary_or_binary_function<_Res, _T1>
- : std::unary_function<_T1, _Res> { };
-
- /// Derives from @c binary_function, as appropriate.
- template
- struct _Maybe_unary_or_binary_function<_Res, _T1, _T2>
- : std::binary_function<_T1, _T2, _Res> { };
-
- template
- struct _Mem_fn_traits;
-
- template
- struct _Mem_fn_traits_base
- {
- using __result_type = _Res;
- using __class_type = _Class;
- using __arg_types = _Pack<_ArgTypes...>;
- using __maybe_type
- = _Maybe_unary_or_binary_function<_Res, _Class*, _ArgTypes...>;
- using __arity = integral_constant;
- };
-
-#define _GLIBCXX_MEM_FN_TRAITS2(_CV, _REF, _LVAL, _RVAL) \
- template \
- struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) _CV _REF> \
- : _Mem_fn_traits_base<_Res, _CV _Class, _ArgTypes...> \
- { \
- using __pmf_type = _Res (_Class::*)(_ArgTypes...) _CV _REF; \
- using __lvalue = _LVAL; \
- using __rvalue = _RVAL; \
- using __vararg = false_type; \
- }; \
- template \
- struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) _CV _REF> \
- : _Mem_fn_traits_base<_Res, _CV _Class, _ArgTypes...> \
- { \
- using __pmf_type = _Res (_Class::*)(_ArgTypes... ...) _CV _REF; \
- using __lvalue = _LVAL; \
- using __rvalue = _RVAL; \
- using __vararg = true_type; \
- };
-
-#define _GLIBCXX_MEM_FN_TRAITS(_REF, _LVAL, _RVAL) \
- _GLIBCXX_MEM_FN_TRAITS2( , _REF, _LVAL, _RVAL) \
- _GLIBCXX_MEM_FN_TRAITS2(const , _REF, _LVAL, _RVAL) \
- _GLIBCXX_MEM_FN_TRAITS2(volatile , _REF, _LVAL, _RVAL) \
- _GLIBCXX_MEM_FN_TRAITS2(const volatile, _REF, _LVAL, _RVAL)
-
-_GLIBCXX_MEM_FN_TRAITS( , true_type, true_type)
-_GLIBCXX_MEM_FN_TRAITS(&, true_type, false_type)
-_GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
-
-#undef _GLIBCXX_MEM_FN_TRAITS
-#undef _GLIBCXX_MEM_FN_TRAITS2
-
- template::value>
- class _Mem_fn_base
- : public _Mem_fn_traits<_MemFunPtr>::__maybe_type
- {
- using _Traits = _Mem_fn_traits<_MemFunPtr>;
-
- using _Class = typename _Traits::__class_type;
- using _ArgTypes = typename _Traits::__arg_types;
- using _Pmf = typename _Traits::__pmf_type;
-
- using _Arity = typename _Traits::__arity;
- using _Varargs = typename _Traits::__vararg;
-
- template
- friend struct _Bind_check_arity;
-
- // for varargs functions we just check the number of arguments,
- // otherwise we also check they are convertible.
- template
- using _CheckArgs = typename conditional<_Varargs::value,
- __bool_constant<(_Args::value >= _ArgTypes::value)>,
- _AllConvertible<_Args, _ArgTypes>
- >::type;
-
- public:
- using result_type = typename _Traits::__result_type;
-
- explicit _Mem_fn_base(_Pmf __pmf) : _M_pmf(__pmf) { }
-
- // Handle objects
- template>>>
- result_type
- operator()(_Class& __object, _Args&&... __args) const
- { return (__object.*_M_pmf)(std::forward<_Args>(__args)...); }
-
- template>>>
- result_type
- operator()(_Class&& __object, _Args&&... __args) const
- {
- return (std::move(__object).*_M_pmf)(std::forward<_Args>(__args)...);
- }
-
- // Handle pointers
- template>>>
- result_type
- operator()(_Class* __object, _Args&&... __args) const
- { return (__object->*_M_pmf)(std::forward<_Args>(__args)...); }
-
- // Handle smart pointers, references and pointers to derived
- template, _NotSame<_Class*, _Tp>,
- _CheckArgs<_Pack<_Args...>>>>
- result_type
- operator()(_Tp&& __object, _Args&&... __args) const
- {
- return _M_call(std::forward<_Tp>(__object), &__object,
- std::forward<_Args>(__args)...);
- }
-
- // Handle reference wrappers
- template, typename _Traits::__lvalue,
- _CheckArgs<_Pack<_Args...>>>>
- result_type
- operator()(reference_wrapper<_Tp> __ref, _Args&&... __args) const
- { return operator()(__ref.get(), std::forward<_Args>(__args)...); }
-
- private:
- template
- result_type
- _M_call(_Tp&& __object, const volatile _Class *,
- _Args&&... __args) const
- {
- return (std::forward<_Tp>(__object).*_M_pmf)
- (std::forward<_Args>(__args)...);
- }
-
- template
- result_type
- _M_call(_Tp&& __ptr, const volatile void *, _Args&&... __args) const
- { return ((*__ptr).*_M_pmf)(std::forward<_Args>(__args)...); }
-
- _Pmf _M_pmf;
- };
-
- // Partial specialization for member object pointers.
- template
- class _Mem_fn_base<_Res _Class::*, false>
- {
- using __pm_type = _Res _Class::*;
-
- // This bit of genius is due to Peter Dimov, improved slightly by
- // Douglas Gregor.
- // Made less elegant to support perfect forwarding and noexcept.
- template
- auto
- _M_call(_Tp&& __object, const _Class *) const noexcept
- -> decltype(std::forward<_Tp>(__object).*std::declval<__pm_type&>())
- { return std::forward<_Tp>(__object).*_M_pm; }
-
- template
- auto
- _M_call(_Tp&& __object, _Up * const *) const noexcept
- -> decltype((*std::forward<_Tp>(__object)).*std::declval<__pm_type&>())
- { return (*std::forward<_Tp>(__object)).*_M_pm; }
-
- template
- auto
- _M_call(_Tp&& __ptr, const volatile void*) const
- noexcept(noexcept((*__ptr).*std::declval<__pm_type&>()))
- -> decltype((*__ptr).*std::declval<__pm_type&>())
- { return (*__ptr).*_M_pm; }
-
- using _Arity = integral_constant;
- using _Varargs = false_type;
-
- template
- friend struct _Bind_check_arity;
-
- public:
- explicit
- _Mem_fn_base(_Res _Class::*__pm) noexcept : _M_pm(__pm) { }
-
- // Handle objects
- _Res&
- operator()(_Class& __object) const noexcept
- { return __object.*_M_pm; }
-
- const _Res&
- operator()(const _Class& __object) const noexcept
- { return __object.*_M_pm; }
-
- _Res&&
- operator()(_Class&& __object) const noexcept
- { return std::forward<_Class>(__object).*_M_pm; }
-
- const _Res&&
- operator()(const _Class&& __object) const noexcept
- { return std::forward(__object).*_M_pm; }
-
- // Handle pointers
- _Res&
- operator()(_Class* __object) const noexcept
- { return __object->*_M_pm; }
-
- const _Res&
- operator()(const _Class* __object) const noexcept
- { return __object->*_M_pm; }
-
- // Handle smart pointers and derived
- template>>
- auto
- operator()(_Tp&& __unknown) const
- noexcept(noexcept(std::declval<_Mem_fn_base*>()->_M_call
- (std::forward<_Tp>(__unknown), &__unknown)))
- -> decltype(this->_M_call(std::forward<_Tp>(__unknown), &__unknown))
- { return _M_call(std::forward<_Tp>(__unknown), &__unknown); }
-
- template>>
- auto
- operator()(reference_wrapper<_Tp> __ref) const
- noexcept(noexcept(std::declval<_Mem_fn_base&>()(__ref.get())))
- -> decltype((*this)(__ref.get()))
- { return (*this)(__ref.get()); }
-
- private:
- _Res _Class::*_M_pm;
- };
-
- template
- struct _Mem_fn<_Res _Class::*>
- : _Mem_fn_base<_Res _Class::*>
- {
- using _Mem_fn_base<_Res _Class::*>::_Mem_fn_base;
- };
-
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 2048. Unnecessary mem_fn overloads
- /**
- * @brief Returns a function object that forwards to the member
- * pointer @a pm.
- * @ingroup functors
- */
- template
- inline _Mem_fn<_Tp _Class::*>
- mem_fn(_Tp _Class::* __pm) noexcept
- {
- return _Mem_fn<_Tp _Class::*>(__pm);
- }
-
- /**
- * @brief Determines if the given type _Tp is a function object
- * should be treated as a subexpression when evaluating calls to
- * function objects returned by bind(). [TR1 3.6.1]
- * @ingroup binders
- */
- template
- struct is_bind_expression
- : public false_type { };
-
- /**
- * @brief Determines if the given type _Tp is a placeholder in a
- * bind() expression and, if so, which placeholder it is. [TR1 3.6.2]
- * @ingroup binders
- */
- template
- struct is_placeholder
- : public integral_constant
- { };
-
- /** @brief The type of placeholder objects defined by libstdc++.
- * @ingroup binders
- */
- template struct _Placeholder { };
-
- _GLIBCXX_END_NAMESPACE_VERSION
-
- /** @namespace std::placeholders
- * @brief ISO C++11 entities sub-namespace for functional.
- * @ingroup binders
- */
- namespace placeholders
- {
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
- /* Define a large number of placeholders. There is no way to
- * simplify this with variadic templates, because we're introducing
- * unique names for each.
- */
- extern const _Placeholder<1> _1;
- extern const _Placeholder<2> _2;
- extern const _Placeholder<3> _3;
- extern const _Placeholder<4> _4;
- extern const _Placeholder<5> _5;
- extern const _Placeholder<6> _6;
- extern const _Placeholder<7> _7;
- extern const _Placeholder<8> _8;
- extern const _Placeholder<9> _9;
- extern const _Placeholder<10> _10;
- extern const _Placeholder<11> _11;
- extern const _Placeholder<12> _12;
- extern const _Placeholder<13> _13;
- extern const _Placeholder<14> _14;
- extern const _Placeholder<15> _15;
- extern const _Placeholder<16> _16;
- extern const _Placeholder<17> _17;
- extern const _Placeholder<18> _18;
- extern const _Placeholder<19> _19;
- extern const _Placeholder<20> _20;
- extern const _Placeholder<21> _21;
- extern const _Placeholder<22> _22;
- extern const _Placeholder<23> _23;
- extern const _Placeholder<24> _24;
- extern const _Placeholder<25> _25;
- extern const _Placeholder<26> _26;
- extern const _Placeholder<27> _27;
- extern const _Placeholder<28> _28;
- extern const _Placeholder<29> _29;
- _GLIBCXX_END_NAMESPACE_VERSION
- }
-
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- /**
- * Partial specialization of is_placeholder that provides the placeholder
- * number for the placeholder objects defined by libstdc++.
- * @ingroup binders
- */
- template
- struct is_placeholder<_Placeholder<_Num> >
- : public integral_constant
- { };
-
- template
- struct is_placeholder >
- : public integral_constant
- { };
-
- /**
- * Used by _Safe_tuple_element to indicate that there is no tuple
- * element at this position.
- */
- struct _No_tuple_element;
-
- /**
- * Implementation helper for _Safe_tuple_element. This primary
- * template handles the case where it is safe to use @c
- * tuple_element.
- */
- template
- struct _Safe_tuple_element_impl
- : tuple_element<__i, _Tuple> { };
-
- /**
- * Implementation helper for _Safe_tuple_element. This partial
- * specialization handles the case where it is not safe to use @c
- * tuple_element. We just return @c _No_tuple_element.
- */
- template
- struct _Safe_tuple_element_impl<__i, _Tuple, false>
- {
- typedef _No_tuple_element type;
- };
-
- /**
- * Like tuple_element, but returns @c _No_tuple_element when
- * tuple_element would return an error.
- */
- template
- struct _Safe_tuple_element
- : _Safe_tuple_element_impl<__i, _Tuple,
- (__i < tuple_size<_Tuple>::value)>
- { };
-
- /**
- * Maps an argument to bind() into an actual argument to the bound
- * function object [TR1 3.6.3/5]. Only the first parameter should
- * be specified: the rest are used to determine among the various
- * implementations. Note that, although this class is a function
- * object, it isn't entirely normal because it takes only two
- * parameters regardless of the number of parameters passed to the
- * bind expression. The first parameter is the bound argument and
- * the second parameter is a tuple containing references to the
- * rest of the arguments.
- */
- template::value,
- bool _IsPlaceholder = (is_placeholder<_Arg>::value > 0)>
- class _Mu;
-
- /**
- * If the argument is reference_wrapper<_Tp>, returns the
- * underlying reference. [TR1 3.6.3/5 bullet 1]
- */
- template
- class _Mu, false, false>
- {
- public:
- typedef _Tp& result_type;
-
- /* Note: This won't actually work for const volatile
- * reference_wrappers, because reference_wrapper::get() is const
- * but not volatile-qualified. This might be a defect in the TR.
- */
- template
- result_type
- operator()(_CVRef& __arg, _Tuple&) const volatile
- { return __arg.get(); }
- };
-
- /**
- * If the argument is a bind expression, we invoke the underlying
- * function object with the same cv-qualifiers as we are given and
- * pass along all of our arguments (unwrapped). [TR1 3.6.3/5 bullet 2]
- */
- template
- class _Mu<_Arg, true, false>
- {
- public:
- template
- auto
- operator()(_CVArg& __arg,
- tuple<_Args...>& __tuple) const volatile
- -> decltype(__arg(declval<_Args>()...))
- {
- // Construct an index tuple and forward to __call
- typedef typename _Build_index_tuple::__type
- _Indexes;
- return this->__call(__arg, __tuple, _Indexes());
- }
-
- private:
- // Invokes the underlying function object __arg by unpacking all
- // of the arguments in the tuple.
- template
- auto
- __call(_CVArg& __arg, tuple<_Args...>& __tuple,
- const _Index_tuple<_Indexes...>&) const volatile
- -> decltype(__arg(declval<_Args>()...))
- {
- return __arg(std::forward<_Args>(std::get<_Indexes>(__tuple))...);
- }
- };
-
- /**
- * If the argument is a placeholder for the Nth argument, returns
- * a reference to the Nth argument to the bind function object.
- * [TR1 3.6.3/5 bullet 3]
- */
- template
- class _Mu<_Arg, false, true>
- {
- public:
- template class result;
-
- template
- class result<_CVMu(_CVArg, _Tuple)>
- {
- // Add a reference, if it hasn't already been done for us.
- // This allows us to be a little bit sloppy in constructing
- // the tuple that we pass to result_of<...>.
- typedef typename _Safe_tuple_element<(is_placeholder<_Arg>::value
- - 1), _Tuple>::type
- __base_type;
-
- public:
- typedef typename add_rvalue_reference<__base_type>::type type;
- };
-
- template
- typename result<_Mu(_Arg, _Tuple)>::type
- operator()(const volatile _Arg&, _Tuple& __tuple) const volatile
- {
- return std::forward::type>(
- ::std::get<(is_placeholder<_Arg>::value - 1)>(__tuple));
- }
- };
-
- /**
- * If the argument is just a value, returns a reference to that
- * value. The cv-qualifiers on the reference are the same as the
- * cv-qualifiers on the _Mu object. [TR1 3.6.3/5 bullet 4]
- */
- template
- class _Mu<_Arg, false, false>
- {
- public:
- template struct result;
-
- template
- struct result<_CVMu(_CVArg, _Tuple)>
- {
- typedef typename add_lvalue_reference<_CVArg>::type type;
- };
-
- // Pick up the cv-qualifiers of the argument
- template
- _CVArg&&
- operator()(_CVArg&& __arg, _Tuple&) const volatile
- { return std::forward<_CVArg>(__arg); }
- };
-
- /**
- * Maps member pointers into instances of _Mem_fn but leaves all
- * other function objects untouched. Used by std::bind(). The
- * primary template handles the non-member-pointer case.
- */
- template
- struct _Maybe_wrap_member_pointer
- {
- typedef _Tp type;
-
- static const _Tp&
- __do_wrap(const _Tp& __x)
- { return __x; }
-
- static _Tp&&
- __do_wrap(_Tp&& __x)
- { return static_cast<_Tp&&>(__x); }
- };
-
- /**
- * Maps member pointers into instances of _Mem_fn but leaves all
- * other function objects untouched. Used by std::bind(). This
- * partial specialization handles the member pointer case.
- */
- template
- struct _Maybe_wrap_member_pointer<_Tp _Class::*>
- {
- typedef _Mem_fn<_Tp _Class::*> type;
-
- static type
- __do_wrap(_Tp _Class::* __pm)
- { return type(__pm); }
- };
-
- // Specialization needed to prevent "forming reference to void" errors when
- // bind() is called, because argument deduction instantiates
- // _Maybe_wrap_member_pointer outside the immediate context where
- // SFINAE applies.
- template<>
- struct _Maybe_wrap_member_pointer
- {
- typedef void type;
- };
-
- // std::get for volatile-qualified tuples
- template
- inline auto
- __volget(volatile tuple<_Tp...>& __tuple)
- -> __tuple_element_t<_Ind, tuple<_Tp...>> volatile&
- { return std::get<_Ind>(const_cast&>(__tuple)); }
-
- // std::get for const-volatile-qualified tuples
- template
- inline auto
- __volget(const volatile tuple<_Tp...>& __tuple)
- -> __tuple_element_t<_Ind, tuple<_Tp...>> const volatile&
- { return std::get<_Ind>(const_cast&>(__tuple)); }
-
- /// Type of the function object returned from bind().
- template
- struct _Bind;
-
- template
- class _Bind<_Functor(_Bound_args...)>
- : public _Weak_result_type<_Functor>
- {
- typedef _Bind __self_type;
- typedef typename _Build_index_tuple::__type
- _Bound_indexes;
-
- _Functor _M_f;
- tuple<_Bound_args...> _M_bound_args;
-
- // Call unqualified
- template
- _Result
- __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>)
- {
- return _M_f(_Mu<_Bound_args>()
- (std::get<_Indexes>(_M_bound_args), __args)...);
- }
-
- // Call as const
- template
- _Result
- __call_c(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const
- {
- return _M_f(_Mu<_Bound_args>()
- (std::get<_Indexes>(_M_bound_args), __args)...);
- }
-
- // Call as volatile
- template
- _Result
- __call_v(tuple<_Args...>&& __args,
- _Index_tuple<_Indexes...>) volatile
- {
- return _M_f(_Mu<_Bound_args>()
- (__volget<_Indexes>(_M_bound_args), __args)...);
- }
-
- // Call as const volatile
- template
- _Result
- __call_c_v(tuple<_Args...>&& __args,
- _Index_tuple<_Indexes...>) const volatile
- {
- return _M_f(_Mu<_Bound_args>()
- (__volget<_Indexes>(_M_bound_args), __args)...);
- }
-
- public:
- template
- explicit _Bind(const _Functor& __f, _Args&&... __args)
- : _M_f(__f), _M_bound_args(std::forward<_Args>(__args)...)
- { }
-
- template
- explicit _Bind(_Functor&& __f, _Args&&... __args)
- : _M_f(std::move(__f)), _M_bound_args(std::forward<_Args>(__args)...)
- { }
-
- _Bind(const _Bind&) = default;
-
- _Bind(_Bind&& __b)
- : _M_f(std::move(__b._M_f)), _M_bound_args(std::move(__b._M_bound_args))
- { }
-
- // Call unqualified
- template()(
- _Mu<_Bound_args>()( std::declval<_Bound_args&>(),
- std::declval&>() )... ) )>
- _Result
- operator()(_Args&&... __args)
- {
- return this->__call<_Result>(
- std::forward_as_tuple(std::forward<_Args>(__args)...),
- _Bound_indexes());
- }
-
- // Call as const
- template= 0),
- typename add_const<_Functor>::type>::type>()(
- _Mu<_Bound_args>()( std::declval(),
- std::declval&>() )... ) )>
- _Result
- operator()(_Args&&... __args) const
- {
- return this->__call_c<_Result>(
- std::forward_as_tuple(std::forward<_Args>(__args)...),
- _Bound_indexes());
- }
-
- // Call as volatile
- template= 0),
- typename add_volatile<_Functor>::type>::type>()(
- _Mu<_Bound_args>()( std::declval(),
- std::declval