Chris ( Val ) wrote:
> typedef' in themselves do not create any objects,
> they create 'synonyms' - AKA: A symbolic substitute,
> also known as an 'alias' for another object.
>
> Objects are instantiated later down the track:
>
> This:
> typedef vector<std::string> vNames;
In the special case of a template, typedef-ing also instantiates the target
class, meaning certain lookup paths from inside the template to external
identifiers get nailed down. By contrast...
#define vNames vector<std::string>
would reinstantiate the template each time vNames is used. I suspect that
can introduce subtle bugs.
--
Phlip
http://www.c2.com/cgi/wiki?ZeekLand