C++ Define Class in One File and Forward Declare It in Another

Is it legal/advised to do this in C++

    #include "WinImplementation.h"
    #include "NixImplementation.h"
    class Interface {
        class WinImplementation;
        class NixImplementation;

    #include "Interface.h"
    class Interface::WinImplementation {}

    #include "Interface.h"
    class Interface::NixImplementation {}


Yes, you can forward declare nested classes in C++. The following example is taken directly from the C++ standard (section 9.7.3):

class E
    class I1;     // forward declaration of nested class
    class I2;
    class I1 {};  // definition of nested class
class E::I2 {};   // definition of nested class

Need Your Help

Quartz scheduler Not Working after exception

java exception weblogic scheduled-tasks quartz-scheduler

I am currently working with Quartz scheduler in my web application to schedule a task after running the server and then repeat it in regular interval.

Retrieve user playlist using YouTube API

asp.net .net youtube youtube-api

I have this code at the moment that authenticates a user and tries to retrieve the current authenticated users playlist but the request is inavlid and the error is as so

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.