TITLE: copy constructors disallowed as member templates (Newsgroups: comp.lang.c++.moderated, 27 June 99) VOGLER: cvogler@gradin.cis.upenn.edu (Christian Vogler) >Out of curiosity, why are template constructors never considered to be >a copy constructor? CLAMAGE: Steve Clamage To insure consistent copy semantics throughout a program, neither copy constructors nor copy-assignment operators can be templates. For the same reason, they must be member functions. If not for these rules, copying objects could give different results depending on which declarations were visible in the translations unit. (A template specialization can be declared separately from the main template declaration and definition.) The requirement that copy operations be non-template member functions ensures a consistent set of declarations is always visible whenever a copy operation can be performed. You can raise similar concerns about overloaded functions in general: the function that gets called can depend on which declarations happen to be visible. But copy operations are considered fundamental, and so get special treatment.