I have a class template that in turn contains a template class. That internal template class in turn has as a constructor that takes a function pointer. I've used this internal class before for loading an XML file and now I'm trying my hand at creating an XML converter using this class. The problem is in providing an adequate set of constructor parameters for the internal class.

**EDIT** I've taken on board some of the comments left regarding temporary const strings, etc., and taken the time to create a simplified case that still exhibits my problem. I've made substantial edits to the question. Using the code posted below the error returned now is 

```
FormatConverter/main.cpp:7:   instantiated from here
FormatConverter/FormatConverter.h:52: error: no matching function for call to 'XMLLoader<MessageType1>::XMLLoader(<unknown type>, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
FormatConverter/XMLLoader.h:40: note: candidates are: XMLLoader<XMLTYPE>::XMLLoader(std::auto_ptr<XMLTYPE> (*)(std::istream&, std::string&, std::string&), const std::string&, const std::string&) [with XMLTYPE = MessageType1]
FormatConverter/XMLLoader.h:10: note: XMLLoader<MessageType1>::XMLLoader(const XMLLoader<MessageType1>&)

```

//main.cpp

```
#include <iostream>
#include "FormatConverter.h"
#include "MessageTypes.h"

int main (int argc, char * const argv[]) {
std::string options = "";
FormatConverter<MessageType1, MessageType2> fConverter( options );
    return 0;
}

```

//MessageTypes.h

```
#ifndef _MTYPES_
#define _MTYPES_

class MessageType1 
{  };

class MessageType2
{  };

#endif

```

//FormatConverter.h

```
#ifndef _FORMAT_CONVERTER_
#define _FORMAT_CONVERTER_

#include "XMLLoader.h"
#include <memory>
#include <string>

template<typename T>
::std::auto_ptr<T>
dummyLoader( ::std::istream& dummyStream, std::string dummyFlags, std::string dummyProps )
{
return ::std::auto_ptr<T>( new(T) );
}

template<>
::std::auto_ptr<MessageType1>
dummyLoader( ::std::istream& dummyStream, std::string dummyFlags, std::string dummyProps )
{
return ::std::auto_ptr<MessageType1>( new(MessageType1) );
}

template<>
::std::auto_ptr<MessageType2>
dummyLoader( ::std::istream& dummyStream, std::string dummyFlags, std::string dummyProps )
{
return ::std::auto_ptr<MessageType2>( new(MessageType2) );
}

template <typename IN, typename OUT>
class FormatConverter {
public:
FormatConverter( std::string& options );
virtual ~FormatConverter( void );

void convert( std::auto_ptr<IN> input, std::string& stuff );

private:    
std::string options_;
const std::string dummyFlags;
const std::string dummyProps;

XMLLoader<IN> loader_;
};

template <typename IN, typename OUT>
FormatConverter<IN, OUT>::FormatConverter( std::string& options )
: options_(options)
, dummyFlags("")
, dummyProps("")
, loader_ ( dummyLoader<IN>,
        dummyFlags,
        dummyProps )
{ }

template <typename IN, typename OUT>
FormatConverter<IN,OUT>::~FormatConverter( void )
{ }

template<typename IN, typename OUT>
void
FormatConverter<IN, OUT>::convert( std::auto_ptr<IN> input, std::string& stuff )
{ }
#endif

```

//XMLLoader.h

```
#ifndef _XMLLoader_H
#define _XMLLoader_H

#include <memory>
#include <string>

template <typename XMLTYPE>
class XMLLoader
    {
    public:
        typedef ::std::auto_ptr<XMLTYPE> MSG_LOADER( std::istream&,
                                                 std::string&,   //flags
                                                         std::string& ); //properties

        XMLLoader(  MSG_LOADER *loader,
                        const std::string& schemaSource = "NONE",
                        const std::string& ns="" );

        virtual ~XMLLoader(void);
        virtual std::auto_ptr<XMLTYPE> load(std::istream &is);

    private:
        MSG_LOADER* loader_;
        std::string schemaSource_;
        std::string namespace_;
    };

#include <unistd.h>
#include <stdexcept>
#include "XMLLoader.h"

template<typename XMLTYPE>
XMLLoader<XMLTYPE>::XMLLoader(MSG_LOADER* loader,
                              const std::string& schemaSource,
                              const std::string& ns)
: loader_(loader)
, schemaSource_(schemaSource)
, namespace_(ns)
{ /* stuff */ }

template<typename XMLTYPE>
XMLLoader<XMLTYPE>::~XMLLoader( void )
{ }

template<typename XMLTYPE>
::std::auto_ptr<XMLTYPE>
XMLLoader<XMLTYPE>::load( std::istream& is )
{
    std::string flags = "";
    std::string props = "";
    return loader_(is, flags, props );
}

#include "MessageTypes.h"

template
XMLLoader<MessageType1>::XMLLoader(
                                   MSG_LOADER*,
                                   const std::string&,
                                   const std::string& );

template
XMLLoader<MessageType1>::~XMLLoader( void );

template
XMLLoader<MessageType2>::XMLLoader(
                                   MSG_LOADER*,
                                   const std::string&,
                                   const std::string& );

template
XMLLoader<MessageType2>::~XMLLoader( void );
#endif

```

an XMLLoader<IN> constructor takes 3 arguments: two strings, and a function pointer. It returns an auto\_ptr<IN> type. My dummyLoader templates seem to satisfy that requirement and I've tried a number of slight variations to my syntax, yet error refers to an .

So, the compiler can't seem to identify the type of dummyLoader I'm trying to pass when instantiating a FormatConverter object. Can anyone explain why?