From f7665a274305133dfc754c5893b09493eb3da565 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 20 Jan 2018 08:49:40 +0000 Subject: [PATCH] Another attempt to fix insert_exception_tests on Visual C++ 7.1 Try extracting the nested template structs. --- test/exception/insert_exception_tests.cpp | 60 +++++++++++------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/test/exception/insert_exception_tests.cpp b/test/exception/insert_exception_tests.cpp index 57314a6e..1043a3fb 100644 --- a/test/exception/insert_exception_tests.cpp +++ b/test/exception/insert_exception_tests.cpp @@ -146,24 +146,24 @@ struct insert_lvalue_end_type : inserter_base } } insert_lvalue_end; +template struct insert_lvalue_pos_type_impl : inserter_base +{ + typename T::iterator pos; + + insert_lvalue_pos_type_impl(T& x) : pos(x.begin()) {} + + template void operator()(T& x, Iterator it) + { + pos = get_iterator(x.insert(pos, *it)); + } +}; + struct insert_lvalue_pos_type { - template struct impl : inserter_base + template + friend insert_lvalue_pos_type_impl generate(insert_lvalue_pos_type, T& x) { - typename T::iterator pos; - - impl(T& x) : pos(x.begin()) {} - - template void operator()(T& x, Iterator it) - { - pos = get_iterator(x.insert(pos, *it)); - } - }; - - template friend impl generate(insert_lvalue_pos_type, T& x) - { - impl r(x); - return r; + return insert_lvalue_pos_type_impl(x); } } insert_lvalue_pos; @@ -199,24 +199,24 @@ struct emplace_lvalue_end_type : inserter_base } } emplace_lvalue_end; +template struct emplace_lvalue_pos_type_impl : inserter_base +{ + typename T::iterator pos; + + emplace_lvalue_pos_type_impl(T& x) : pos(x.begin()) {} + + template void operator()(T& x, Iterator it) + { + pos = get_iterator(x.emplace_hint(pos, *it)); + } +}; + struct emplace_lvalue_pos_type { - template struct impl : inserter_base + template + friend emplace_lvalue_pos_type_impl generate(emplace_lvalue_pos_type, T& x) { - typename T::iterator pos; - - impl(T& x) : pos(x.begin()) {} - - template void operator()(T& x, Iterator it) - { - pos = get_iterator(x.emplace_hint(pos, *it)); - } - }; - - template friend impl generate(emplace_lvalue_pos_type, T& x) - { - impl r(x); - return r; + return emplace_lvalue_pos_type_impl(x); } } emplace_lvalue_pos;