Boost logo

Boost :

From: J.F.K. (beholder_at_[hidden])
Date: 2003-10-29 01:23:27

Yes, it is very interesting!
I've had a look to your documentation and I think your example
could be rewritten as that

class Foo {
public: // ...'tors
    Foo (int bar=0)
       : m_bar(bar), bar(this)

public: // properties
    struct bar_tag {};
setgetter<property<Foo, int>, bar_tag> bar;

private: // implementation details
    void set (const int bar, bar_tag=bar_tag())
    { m_bar = bar; }

    const int get (bar_tag=bar_tag()) const
    { return m_bar; }

    int m_bar;

Foo object; = 22;
std::cout << << '\n';

the idea is that now setgetter knows what a function it must
call to access m_bar without passing pointers of these
functions to getsetter constructor

I really hate ponters here, because of pessimisation, most of
compilers can't inline function if pointer on it is used


"Matthias Becker" <bekkah_at_[hidden]> wrote in message
> Hi
> I develope a small libray for my needs. But there is one part that could be used everywhere. It is somewhat similar to C#'s getter and setter. I thougt it might be interesing for boost.
> this file includes a small documentation and all files that you need.
> CU

Boost list run by bdawes at, gregod at, cpdaniel at, john at