Most C++ compilers I've worked with accept the following
#include <map>
struct A;
struct B
{
typedef std::map<int,A>::iterator iterator;
std::map<int,A> test;
};
struct A
{
};
int main()
{
return 0;
}
however, Apple clang 4.0 compiled with
clang++ test.cpp -o test -std=c++11 -stdlib=libc++
produces a collection of errors that imply A must be a complete type before std::map can be used. Is this a defect in the libc++ implementation of map, a new requirement imposed by C++11 or a bad assumption on my part?