coding standard: typedef of a full template instantiation

Discussion in 'C++' started by Hicham Mouline, Dec 3, 2008.

  1. namespace com { namespace product {

    template < typename T1, typename T2 > class S;

    namespace subns {

    typedef S<int, int> S;

    }

    }


    Note here the type subns::S overrides the S template from the enclosing
    namespace.

    This compiles ok with VS and g++.


    Is this use frowned upon? against coding styles out there?

    regards,
    Hicham Mouline, Dec 3, 2008
    #1
    1. Advertising

  2. Hicham Mouline

    Noah Roberts Guest

    Hicham Mouline wrote:
    > namespace com { namespace product {
    >
    > template < typename T1, typename T2 > class S;
    >
    > namespace subns {
    >
    > typedef S<int, int> S;
    >
    > }
    >
    > }
    >
    >
    > Note here the type subns::S overrides the S template from the enclosing
    > namespace.
    >
    > This compiles ok with VS and g++.
    >
    >
    > Is this use frowned upon? against coding styles out there?
    >
    > regards,
    >
    >


    Since I could get confused about what S is, yeah...I'd bitch about it in
    a code review.
    Noah Roberts, Dec 3, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fernando Cuenca
    Replies:
    4
    Views:
    2,523
    Gianni Mariani
    Sep 6, 2004
  2. Thomas Maier-Komor
    Replies:
    6
    Views:
    615
    Thomas Maier-Komor
    May 19, 2005
  3. Replies:
    1
    Views:
    571
    Salt_Peter
    Dec 25, 2006
  4. Ed
    Replies:
    1
    Views:
    342
  5. shaan
    Replies:
    2
    Views:
    539
    shaan
    Jul 2, 2012
Loading...

Share This Page