c++ - Inheriting classes and namespaces -
what want make changements in func.cpp , func.h inherit main.cpp , then, generate diagram class @ end in states func inherited.
i want make changements in code, namespace classes, allow inheritance process.
i ' m having follow:
in func.h:
namespace func { void f1(...); void f2(...); }
in func.cpp
namespace func { void f1(...) { } void f2(...) { } }
in test.cpp (which meantime class having test.h) , it's possible call f1 , f2 follow:
func::f1(...); func::f2(...);
if change namespace class, still want call func1
, func2
using same syntax (e.g. func::func1()
), have make functions static
:
struct func { static void func1(); static void func2(); };
if want override func1
in inherited class it's simple:
struct func2 : public func { static void func1(); };
there problems static member functions, in can't access non-static members easily.
Comments
Post a Comment