
AMDG On 09/30/2012 10:18 AM, Adam Wulkiewicz wrote:
Hi,
Currently I'm working on a spatial index and was considering using methods templates until I've tested it on GCC. Consider the following simple example:
template <typename T1, typename T2> struct boom {};
struct aaa { template <typename T> void boom() {} };
template <typename T> struct bbb { void test() { T t; t.template boom<int>(); // <- here GCC resolves struct boom } };
<snip>
This is not the case on VC++ or clang. Also, not the case if structs can't be found by the compiler (e.g. are in the different namespace). But what if some library defines some struct template and includes other library which defines method template with the same name? Is GCC standard-compliant in this case?
Definitely not. The names should be resolved as members of the class, not using unqualified lookup. In Christ, Steven Watanabe P.S. Please don't reply to an existing thread with new subject. Start a new thread instead.