Tree containers profile mode fix

Jonathan Wakely jwakely.gcc@gmail.com
Wed Jan 15 17:13:00 GMT 2014


On 15 January 2014 16:59, François Dumont wrote:
> 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.

I'm pretty sure you cannot instantiate an alias template. An alias
template's underlying type might not be a template at all.


> 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.

The profile mode parts are OK, but the ChangeLog entry seems to have
extra files listed that are not in the patch. I assume the ChangeLog
is wrong?



More information about the Libstdc++ mailing list