'Instantiating an object and getting the error "No instance of constructor matches the argument list"

I've pseudoed the section of the ".h" file (which doesn't belong to me so I can't change it) to add here and was wondering if any of you way more experienced C++ programmers can summarize what it does for me and how to go about using it? Especially what affects the conditions #if defined blocks play. I know that what follows them are conditionally added to the code, but just trying to understand what coding around them and the path to the various objects in the ".h" would look like. I've been rolling along quite happily until I came across this stumbling block.

What I'm trying to do is to instantiate a "ClassA" object "*myClassAObj" so that I can access the object members and functions such as std::string title, EnumC enumc and Preset() for example, but failing miserably.

"myClassA.h"

namespace ns1
{
    #if defined(CONDITION_A)
        namespace ns2
        {
            class ClassA;
        }
    #endif

    namespace main_ns
    {
        class ClassB;
    
        class ClassA
        {
            public:
                #if defined(CONDITION_A)
                    class Preset
                    {
                        public:
                            enum EnumA
                            {
                                EnumAParam      = 10
                            };

                            enum EnumB
                            {
                                EnumBParam      = 10
                            };

                            enum EnumC
                            {
                                EnumCParam      = 10
                            };

                            enum EnumD
                            {
                                EnumDParam      = 10
                            };

                            std::string title;
                            
                            EnumC enumc;
                            
                            Preset();
                            
                            virtual ~Preset();
                    };
                #endif

                ClassA();

                #if defined(CONDITION_A)
                    ClassA(const std::string& preset_, const bool someBool_);

                    ClassA(const Preset& preset_, const bool someBool_);
                #endif
                
                virtual ~ClassA();
            
                virtual void save() const;

                virtual void close() const;

            private:
                #if defined(CONDITION_A)
                    friend ns2::ClassA* __accessImpl(const ClassA&);
                    friend ClassA __accessCtor(ns2::ClassA*&);
                #endif
        };
        
        typedef std::auto_ptr<ClassA> ClassAAP;
        
        #if defined(CONDITION_A)
            extern ns2::ClassA* __accessImpl(const ClassA&);
            extern ClassA __accessCtor(ns2::ClassA*&);
        #endif
    }
}

"myClassA.cpp"

With this implementation I get the intellisense error "No instance of constructor "ns1::main_ns::ClassA::ClassA" matches the argument list - argument types are: (const ns1::main_ns::ClassA::Preset::EnumC, bool)

#include "myClassA.h"

void createMyClassAObj()
{
    showAlertMessageBox("Called");

    const ns1::main_ns::ClassA::Preset::EnumC myEnumC = ns1::main_ns::ClassA::Preset::EnumC::EnumCParam;

    ns1::main_ns::ClassA *myClassAObj = new ns1::main_ns::ClassA(myEnumC, true); 
}

With this implementation of first just declaring my "myClassAObj", thinking that I may then be able to fully define it and access the members I need after. Which are the members in the .h file like std::string title or Preset(). I instead only have access to the members like save() and close() in the Private section at the bottom.

void createMyClassAObj()
{
    showAlertMessageBox("Called");

    ns1::main_ns::ClassA *myClassAObj;
}
c++


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source