Home > Error Cannot > Error Class Member Cannot Be Redeclared

Error Class Member Cannot Be Redeclared

Contents

Search: Forum Beginners Redeclaration a member function Redeclaration a member function Feb 7, 2010 at 12:35am UTC Quentin (47) Hi there! contact us Feb 7, 2010 at 12:46am UTC Disch (13766) Because it doesn't make any sense. 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 ). his comment is here

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 But why is that ? In the case of normal functions, a redeclaration doesn't matter... No new replies allowed. http://stackoverflow.com/questions/14095405/member-function-redeclaration-not-allowed

Error Cannot Redeclare Class Cakephp

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 Redeclaring would unnecessary duplicate code. 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? Topic archived.

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?