Re-ordering C++ template functions -


I have a fixed template function in C ++, which, on a given condition, a template function in another class Makes a call. The problem is that to apply the second class, the full definition of first class is required because it creates a second class and stores it and manages it in the same fashion.

The problem is that naturally, they fall as a class, and thus there is some tight interop, except that I want two classes for threading reasons. One kind, master for all threads, one child per thread, system.

Any advice on how this can be implemented?

Comment @ Comment: I have a problem which is slightly like this:

  class master {public: hair * createChild () {new child return); } Template & lt; Typename T & gt; T * Receive support (return); }}; Class child {Master * Master; Template & lt; Typename T & gt; T * GetSomething (int arg) {if (Rg) returns master-> GetSomething & lt; T & gt; (Arg); And return of return; }};  

This is not a clear real implementation, but is quite similar to display. PIMPL will be helpful only if these are non-template functions, but since they are, IMPL should be right here.

The master class manages all children (why do I select the master and child? Parent / child or master / slave?), Their memory, birthdays etc., and some other system-wide requirements The child class provides most access and in some cases the master class has to come back.

Besides, there is no way in hell that I am moving into dynamic binding. The rest of my systems already completely completely fix dynamic binding, and I can not tolerate the performance of using it again in this fashion. The child function in question is called very, very, very often.

For your example, this fact is a template function in sections that does not make a real difference; After the announcement of the child class, there is a further reference to the child class and the definition of the CreateChild function has been added:

  class children; Class Master {Public: Hair * CreateChild (); Template & lt; Typename T & gt; T * Receive support (return); }}; Classroom Children {Public: Master * Master; Template & lt; Typename T & gt; T * GetSomething (int arg) {if (Rg) returns master-> GetSomething & lt; T & gt; (Arg); And return of return; }}; Hair * master :: CreateChild () {new hair return (); }  

Comments

Post a Comment

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -