VS 2008, error C4430
-
class base { protected: base(const&base) {} }; When the above code is compiled with VS 6.0 compiles without any error, but if the same is compiled in VS 2008 following is the error “error C4430: missing type specifier - int assumed. Note: C++ does not support default-int” Can you please let me know what causes this error.
-
class base { protected: base(const&base) {} }; When the above code is compiled with VS 6.0 compiles without any error, but if the same is compiled in VS 2008 following is the error “error C4430: missing type specifier - int assumed. Note: C++ does not support default-int” Can you please let me know what causes this error.
Are you instantiating the class? If yes, how are you instantiating the class? Where is the default constructor?
It is a crappy thing, but it's life -^ Carlo Pallini
modified on Friday, July 17, 2009 6:05 AM
-
Are you instantiating the class? If yes, how are you instantiating the class? Where is the default constructor?
It is a crappy thing, but it's life -^ Carlo Pallini
modified on Friday, July 17, 2009 6:05 AM
-
Sorry, I overlooked your query. The post is modified. Coffee needed. :-O
It is a crappy thing, but it's life -^ Carlo Pallini
-
Sorry, I overlooked your query. The post is modified. Coffee needed. :-O
It is a crappy thing, but it's life -^ Carlo Pallini
-
class base { protected: base(){} base(const&base) {} }; int _tmain(int argc, _TCHAR* argv[]) { base obj; return 0; } Even if the above case same error.
Nandu_77b wrote:
class base { protected: base(){} base(const&base) {} }; int _tmain(int argc, _TCHAR* argv[]) { base obj; return 0; }
The constructor is not public, so how can you create an object like that? Also, I don't see why would you receive a C4430 for this. I thought it must complain about not being able to access a protected function. (C2448 or whatever, I ain't sure - don't have a compiler here Searched for it, found it - C2248[^]).
It is a crappy thing, but it's life -^ Carlo Pallini
-
class base { protected: base(const&base) {} }; When the above code is compiled with VS 6.0 compiles without any error, but if the same is compiled in VS 2008 following is the error “error C4430: missing type specifier - int assumed. Note: C++ does not support default-int” Can you please let me know what causes this error.
Look at the placement of the reference specifier (the
&
). It' meant to come after the type you want to reference. So, the compiler is seeingconst&base
as (const&
)==type and (base
)==parameter name. Solution - useconst base&
.Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Look at the placement of the reference specifier (the
&
). It' meant to come after the type you want to reference. So, the compiler is seeingconst&base
as (const&
)==type and (base
)==parameter name. Solution - useconst base&
.Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
Mr. Eagle Eye prevails again. I hadn't noticed such a minute thing. Have a 5. :)
It is a crappy thing, but it's life -^ Carlo Pallini
-
class base { protected: base(const&base) {} }; When the above code is compiled with VS 6.0 compiles without any error, but if the same is compiled in VS 2008 following is the error “error C4430: missing type specifier - int assumed. Note: C++ does not support default-int” Can you please let me know what causes this error.
-
Mr. Eagle Eye prevails again. I hadn't noticed such a minute thing. Have a 5. :)
It is a crappy thing, but it's life -^ Carlo Pallini
Rajesh R Subramanian wrote:
Eagle Eye
That's what comes of too many years in safety-critical projects - stringent code reviews are an integral part of the process, so you develop an instinct for those small errors - you get :suss: of anything...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p