C++ templated class multiple inheritance from different unit
I've a Class paramsMapCore
Code:
template <typename KeyType, typename ValueType>
class paramsMapCore : public std::map<KeyType, ValueType>{
...
}
and another Class paramsMap that extends paramsMapCore
Code:
class paramsMap : public paramsMapCore<string, Var>{
...
}
both of this class stays in a different subdirectory called cgi
and they are not in any namespace
under that cgi Directory there is another Directory called jsutil
which has a class Called Js::Object. All Classes in this directory are member of Js namespace.
By the way I am using autotools to manage the build system.
Code:
namespace Js{
class Object: public Js::JVar, public paramsMapCore<string*, Js::JVar*>{
...
}
}
If I remove jsutil subdirectory from cgi/Makefile.am everything works fine and both paramsMap and paramsMapCore compiles and works.
but here when I inherit paramsMapCore on Js::Object It gives Compilation Errors.
Code:
compiling object.cpp (g++)
compiling object.cpp (g++)
cgi/jsutil/../paramsmap.h:36: error: expected template-name before '<' token
cgi/jsutil/../paramsmap.h:36: error: expected `{' before '<' token
cgi/jsutil/../paramsmap.h:36: error: expected unqualified-id before '<' token
cgi/jsutil/object.cpp:34: instantiated from here
cgi/jsutil/../paramsmapcore.hpp:38: error: conversion from 'Var' to 'Js::JVar*' is ambiguous
cgi/jsutil/../var.h:177: note: candidates are: Var::operator int() const <near match>
cgi/jsutil/../var.h:176: note: Var::operator long int() const <near match>
cgi/jsutil/../var.h:175: note: Var::operator char() const <near match>
Not getting any clue to identify the errors.
Please help urgently everything stuck on this point.
I think Its problem of Makefiles If requered I can post my makefiles.am too
one thing I cant understand is when I can compiling the jsutil subdirectory its firing compilation errors from another class of different module.
but If I just remove the jsutil subdirectory It compiles Fine..
and I am using the paramsMapCore Class here so Why Its dealing with pramsMap Class.