From dc9faddf223a622a001c4b3a9790e12312be4cac Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 17 Jan 2018 10:30:20 +0000 Subject: [PATCH] Try to fix constructor_tests on Visual C++ 7.1 I'm really not sure why it fails to compile, the error message isn't very helpful. I assume it might be because allocator1 has an explicit default constructor, so I tried making it implicit. --- test/objects/test.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/objects/test.hpp b/test/objects/test.hpp index 8ea6d2de..8659eae6 100644 --- a/test/objects/test.hpp +++ b/test/objects/test.hpp @@ -354,7 +354,12 @@ namespace test { typedef allocator1 other; }; - explicit allocator1(int t = 0) : tag_(t) + allocator1() : tag_(0) + { + detail::tracker.allocator_ref(); + } + + explicit allocator1(int t) : tag_(t) { detail::tracker.allocator_ref(); } @@ -601,7 +606,12 @@ namespace test { typedef allocator2 other; }; - explicit allocator2(int t = 0) : tag_(t) + allocator2() : tag_(0) + { + detail::tracker.allocator_ref(); + } + + explicit allocator2(int t) : tag_(t) { detail::tracker.allocator_ref(); }