Thread: private struct synthax

  1. #16
    Join Date
    Feb 2008
    Quote Originally Posted by laserlight
    template <class T>
    typename bst<T>::sNode* bst<T>::insert(typename bst<T>::sNode *node, T &data) {
    I just want to point that even the following code compiles correctly:
    template <class T>
    typename bst<T>::sNode* bst<T>::insert(sNode *node, T &data) {

  2. #17
    Join Date
    Oct 2007
    Inside my computer
    I think Visual Studio is good at ignoring the typename (or not requiring) keyword. However, that doesn't mean it's right. The standard says to use it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #18
    Join Date
    Feb 2008
    Infact I was wondering if the compiler was just ignoring that.
    anyway I'm using g++ ;P

  4. #19
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Actually, that's not a case of omitting the typename keyword, but of omitting the containing type within the scope of this type, which is perfectly valid and portable.
    All the buzzt!

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Link List math
    By t014y in forum C Programming
    Replies: 17
    Last Post: 02-20-2009, 06:55 PM
  2. C# and SQL
    By siten0308 in forum C# Programming
    Replies: 2
    Last Post: 07-09-2008, 12:34 PM
  3. Function validation.
    By Fhl in forum C Programming
    Replies: 10
    Last Post: 02-22-2006, 08:18 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. problem with structures and linked list
    By Gkitty in forum C Programming
    Replies: 6
    Last Post: 12-12-2002, 06:40 PM