Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <class T>
- struct isAssContainer {
- static constexpr bool value = false;
- };
- template<class T,class P>
- struct isAssContainer<std::map<T, P>> {
- static constexpr bool value = true;
- };
- //........... подобные для всех остальных
- template <class T>
- struct isAssMultiContainer {
- static constexpr bool value = false;
- };
- template<class T,class P>
- struct isAssMultiContainer<std::multimap<T, P>> {
- static constexpr bool value = true;
- };
- //........... подобные для всех остальных
- template <class T, class P,
- typename std::enable_if<(isAssContainer<P>::value),
- T>::type* = nullptr>
- bool MergeAssociative(T a, P b) {
- std::cout << 1 << std::endl;
- return true;
- }
- template <class T, class P,
- typename std::enable_if<!isAssContainer<P>::value,
- T>::type* = nullptr>
- bool MergeAssociative(T a, P b) {
- std::cout << 0 << ' ' << a << ' ' << std::endl; // a - приходит как адрес
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement