skip to main | skip to sidebar

stupefy developer

blog about software development, *nix and anything that is related to that

Tuesday, January 22, 2008

c++: 'templated' typedef

In current c++ standard(2003) you can't define typedef that uses template. But you have an opportunity to define a class/structure that has a typedef.

template<typename T>
struct __tt
{   
    typedef std::map<std::string, T> smap;
};
And use it:
__tt<int>::smap m;

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

License

Creative Commons License
This blog is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.

My projects

  • libdodo/c++ web toolkit

Articles

  • ►  2010 (3)
    • ►  September (1)
    • ►  June (1)
    • ►  March (1)
  • ►  2009 (23)
    • ►  September (2)
    • ►  July (1)
    • ►  June (1)
    • ►  May (1)
    • ►  April (3)
    • ►  March (6)
    • ►  February (5)
    • ►  January (4)
  • ▼  2008 (81)
    • ►  December (7)
    • ►  November (10)
    • ►  October (20)
    • ►  September (4)
    • ►  August (6)
    • ►  July (1)
    • ►  June (5)
    • ►  May (5)
    • ►  April (5)
    • ►  March (5)
    • ►  February (3)
    • ▼  January (10)
      • awesome tuple ('tcpdump','wireshark')
      • What we expect from the new php
      • c++: 'templated' typedef
      • c++: function nested inside other functions
      • c++: separate methods from their classes
      • importance of documetation
      • postgresql fetching data
      • f(read|write) and (pipe|fifo)s
      • optimizations are (not) evil
      • PF_UNIX
  • ►  2007 (4)
    • ►  December (4)

About Me

My photo
Ni@m
View my complete profile

Links

Участник планеты Developers.org.ua