Boost logo

Boost Users :

Subject: [Boost-users] [Boost.Python] Is it possible classes X Y returned each other?
From: Sergiy Nazarenko (nazarenko.sergiy_at_[hidden])
Date: 2012-06-29 04:23:56


Hi, all!
I'm writing python module and run into obstacle. I need a couple of classes
which can return instance of each other.
This is part of my module:

/// mysupermodule.cpp
...
struct X
{
    X():s("default") {}
    X(std::string s):s(s) {}
    Y getY() const { return Y(); }
};

struct Y
{
    Y():s("default") {}
    Y(std::string s):s(s) {}
    X getX() const { return X(); }
};
...
///
And I got obvious error: mysupermodule.cpp:45:5: error: ‘Y’ does not name
a type.

How can I solve this task?

Regards
Sergiy



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net