R
rogo
Hello folks,
I have a problem with the following code:
---
#include <boost/shared_ptr.hpp>
namespace communication
{
class Result
{
};
}
template <typename Concrete_Container>
class Result_Interpreter
{
public:
typedef ::boost::shared_ptr<Concrete_Container>
Data_Container_Pointer;
typedef ::communication::Result Result;
Data_Container_Pointer interpret_data(const Result& result);
private:
Result_Interpreter();
};
template <typename Concrete_Container>
Result_Interpreter<Concrete_Container>:ata_Container_Pointer
// error:
Result_Interpreter<Concrete_Container>::interpret_data(
const Result_Interpreter::Result& result)
{
Data_Container_Pointer data_container (new Concrete_Container());
return data_container;
}
int main()
{
return 0;
}
---
G++ says "expected constructor, destructor, or type conversion before
»Result_Interpreter«" in the line following "// error:". Could you
give me any pointers why it does not work and how it would? It's not a
pressing matter but I'd like to hide the pointer type (shared_ptr)
from the implementation.
Best Regards
Rogo
I have a problem with the following code:
---
#include <boost/shared_ptr.hpp>
namespace communication
{
class Result
{
};
}
template <typename Concrete_Container>
class Result_Interpreter
{
public:
typedef ::boost::shared_ptr<Concrete_Container>
Data_Container_Pointer;
typedef ::communication::Result Result;
Data_Container_Pointer interpret_data(const Result& result);
private:
Result_Interpreter();
};
template <typename Concrete_Container>
Result_Interpreter<Concrete_Container>:ata_Container_Pointer
// error:
Result_Interpreter<Concrete_Container>::interpret_data(
const Result_Interpreter::Result& result)
{
Data_Container_Pointer data_container (new Concrete_Container());
return data_container;
}
int main()
{
return 0;
}
---
G++ says "expected constructor, destructor, or type conversion before
»Result_Interpreter«" in the line following "// error:". Could you
give me any pointers why it does not work and how it would? It's not a
pressing matter but I'd like to hide the pointer type (shared_ptr)
from the implementation.
Best Regards
Rogo