Pythy icon indicating copy to clipboard operation
Pythy copied to clipboard

Extensiton of Pythy to use it as member function?

Open alfC opened this issue 13 years ago • 0 comments

Are there any plans to make it possible to use PYTHY as member function? As in this example:

#include "pythy.h"
#include <iostream>
struct A{
int x;
PYTHY(min, y)( 
    return x < y ? x : y; 
)
};

int main(int argc, char* argv[]) {
    A a = {5};
    std::cerr << a.min(1) << '\n';
}

Thanks,

alfC avatar Mar 12 '13 05:03 alfC