Ok, I got a a template class. One of the parameters is again supposed to be a class that I write myself. Looks like this:
Then in the actual definition of the class standard_config_formatter I have this:Code:template<typename _C> class standard_config_formatter; template<typename _C, typename _Formatter = standard_config_formatter<_C> > class basic_configfile : public _Formatter // ...
So I'm referencing standard_config_formatter from within standard_config_formatter. This seems to cause problems as VC++7 (6 would probably crash compiling thisCode:template<typename _C> class standard_config_formatter { private: typedef basic_configfile<_C, standard_config_formatter<_C> > my_type;) gives me an error whenever I try using this typedef:
The error is:Code:int get_int_prop(const my_type::string_type &name) {
which seems strange to be because standard_config_formatter is the undefined type, not basic_configfile.d:\work\daten\c++\fwrite\config.h(299) : error C2027: use of undefined type 'config_files::basic_configfile<_C,_Formatter>'
with
[
_C=char,
_Formatter=config_files::standard_config_formatter<char>
]
Anyone has an idea as to why this error occurs? I've got an idea to solve it, but it would take away some of the elegance of the code.
edit: The idea worked.




) gives me an error whenever I try using this typedef:
CornedBee
Reply With Quote