Construction of an intializer_list<string> in a Lambda Capture
问题 So I was cooking up an answer here and I needed to use C++14's identifier initializer within a lambda capture: const auto cmp = [ordering = { "dog", "cat", "mouse", "elephant" }](const string& lhs, const string& rhs) { return find(cbegin(ordering), cend(ordering), lhs) < find(cbegin(ordering), cend(ordering), rhs); }; And this works fine as long as ordering is an intializer_list<const char*> . But for some reason everything falls apart if I make it an intializer_list<string> : const auto cmp