Tree containers profile mode fix

François Dumont frs.dumont@gmail.com
Wed Jan 15 16:59:00 GMT 2014


Hi

     Here is a patch to fix profile mode compilation errors. It makes 
tree based containers C++11 allocator aware in profile mode as they are 
in normal mode. I also try to use default implementation as much as 
possible to benefit from the normal mode noexcept qualifications on the 
defaulted functions.

     Note that for some containers having no profiling instrumentation I 
try to replace the empty wrapper with template alias like:

template <typename _Key, typename _Compare = std::less<_Key>,
                  typename _Alloc = std::allocator<_Key>>
using set = _GLIBCXX_STD_C::set<_Key, _Compare, _Alloc>;

     But some explicit instantiations failed then in the tests. Is it a 
gcc limitation or a Standard requirement to refuse explicit 
instantiation of a template alias ? If It could be interpreted as an 
explicit instantiation of the underlying type it would be really useful.

2014-01-15  François Dumont <fdumont@gcc.gnu.org>

     * include/profile/set.h (set): Implement C++11 allocator-aware
     container requirements.
     * include/profile/map.h (map): Likewise.
     * include/profile/multiset.h (multiset): Likewise.
     * include/profile/multimap.h (multimap): Likewise.
     * include/profile/set.h
     (set::operator=(const set&)): Define as default in C++11 mode.
     (set::operator=(set&&)): Likewise.
     * include/profile/map.h
     (map::operator=(const map&)): Likewise.
     (map::operator=(map&&)): Likewise.
     * include/profile/multiset.h
     (multiset::operator=(const multiset&)): Likewise.
     (multiset::operator=(multiset&&)): Likewise.
     * include/profile/multimap.h
     (multimap::operator=(const multimap&)): Likewise.
     (multimap::operator=(multimap&&)): Likewise.
     * include/profile/set.h (set::operator=(std::initializer_list<>)):
     Rely on the same operator from normal mode.
     * include/profile/map.h (map::operator=(std::initializer_list<>)):
     Likewise.
     * include/profile/multiset.h
     (multiset::operator=(std::initializer_list<>)): Likewise.
     * include/debug/multimap.h
     (multimap::operator=(std::initializer_list<>)): Likewise.
     * include/debug/set.h (set::swap(set&)): Add noexcept
     specification.
     * include/debug/map.h (map::swap(map&)): Likewise.
     * include/debug/multiset.h (multiset::swap(multiset&)): Likewise.
     * include/debug/multimap.h (multimap::swap(multimap&)): Likewise.

Tested under Linux x86_64 normal and profile modes.

François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: profile.patch
Type: text/x-patch
Size: 10944 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20140115/01fdfb5c/attachment.bin>


More information about the Libstdc++ mailing list