Re: Compiler says cctor's definition does not match it's prototype
Code:
Rotor(Rotor& rhs);
Code:
Rotor::Rotor(const Rotor& rhs)
The prototype declaration is different from its definiton - the definiton is const whereas the declaration prototype isn't.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
Re: Compiler says cctor's definition does not match it's prototype
Originally Posted by GCDEF
Post the current definition and prototype.
...and the error it is reporting.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
Re: Compiler says cctor's definition does not match it's prototype
Strange...It compiles now.
Also, since Rotor and Enigma are tightly coupled, should I declare Rotor within Enigma's private section? A Rotor is completely useless without an Enigma.
Last edited by TSLexi; December 30th, 2013 at 08:46 AM.
Re: Compiler says cctor's definition does not match it's prototype
...and the error that is being reported?
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
Re: Compiler says cctor's definition does not match it's prototype
Originally Posted by TSLexi
Also, since Rotor and Enigma are tightly coupled, should I declare Rotor within Enigma's private section? A Rotor is completely useless without an Enigma.
Making Rotor a private nested class in Enigma means that only member functions and friends of Enigma can use the Rotor class. Not sure if that's what you want. If it is, you should consider whether it is possible to keep the Rotor class out of the Enigma header completely and define it in an anonymous namespace in Enigma.cpp.
If you are thinking of making Rotor a public nested class in Enigma, then your question is really a matter of taste, IMO. Using a nested class can prevent the class name from polluting the enclosing namespace. However, it can also make type names pretty long, which makes your code harder to read and it introduces a dependency on the enclosing class whenever the type is needed. I.e. you cannot forward declare a nested class without defining the enclosing class.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.