anti-standard code can compile -- about template class

Joined
Feb 12, 2008
Messages
108
Reaction score
0
Hello everyone,


According to standard, the code should not compile.

http://gcc.gnu.org/onlinedocs/gcc/Name-lookup.html

Code:
      template <typename T> struct Base {
         int i;
       };
     
       template <typename T> struct Derived : public Base<T> {
         int get_i() { return i; }
       };

But it can compile without any issues in Visual Studio 2008, without any warnings and even if I select disable language extensions to yes.

Any comments? What is wrong?


thanks in advance,
George
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top