Home > Error Cannot > Error Class Member Cannot Be Redeclared

Error Class Member Cannot Be Redeclared

Contents

contact us Feb 7, 2010 at 12:44am UTC helios (13227) I can't come up with an answer, but, why would you ever need to do that? No new replies allowed. In the case of normal functions, a redeclaration doesn't matter... weblink

Search: Forum Beginners Redeclaration a member function Redeclaration a member function Feb 7, 2010 at 12:35am UTC Quentin (47) Hi there! Topic archived. I'd like to know why I can't redeclare a member function ( http://msdn.microsoft.com/en-us/library/48c0x0f6%28VS.80%29.aspx ). But why is that ?

Error Class Member Cannot Be Redeclared

For example, this code: 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class TTT { void fun(); void fun() // <---- Redeclaration !!! { } }; //---------------------- class AAA { void fun(); }; void AAA::fun() { } void That's bad for several reasons. (Maintainability reasons, mostly) I suspect the only reason it's allowed for global functions is to retain compatibility with C, which is less strict about things like Feb 7, 2010 at 12:46am UTC Disch (13766) Because it doesn't make any sense.

C++ Information Tutorials Reference Articles Forum Forum BeginnersWindows ProgrammingUNIX/Linux ProgrammingGeneral C++ ProgrammingLoungeJobs Home page | Privacy policy© cplusplus.com, 2000-2016 - All rights reserved - v3.1Spotted an error?