Boost logo

Boost :

Subject: [boost] [unordered] Visual C++ 2013 initializer_list overload failure.
From: Daniel James (daniel_at_[hidden])
Date: 2013-10-19 12:48:01


Hi,

I'm getting some test failures for inserting an initializer_list into
the unordered containers:

http://www.boost.org/development/tests/trunk/developer/output/teeks99-10-win2008-32on64-boost-bin-v2-libs-unordered-test-unordered-insert_tests-test-msvc-12-0-debug.html

I don't have access to Visual C++ 12 to investigate this. This is just
a guess, but I think the problem is converting an initializer_list of
string literals to an initializer list of std::string. This works okay
with clang and g++ so I assume it's allowed. A minimal test might be
something like the following (although it might not).

#include <initializer_list>
#include <string>

template <typename T>
struct thing
{
    void insert(T const&) {}
    void insert(T&&) {}
    void insert(std::initializer_list<T>) {}
};

int main() {
    thing<std::string> x;
    x.insert("a");
    x.insert({"a"});
    x.insert({"a", "b"});
}


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk