export class constant
Dec. 10, 2009
8:25 a.m.
Hi, Let's say I have string literal as static C++ class member: string Foo::abc = "ABC"; I'm exporting the class Foo. I'd like to export Foo::abc as well and be able to access it on Python side using similar interface: Foo.abc. Can I do this using Boost.Python? Gennadiy
December 2009
2:06 p.m.
Gennadiy Rozental wrote:
Hi,
Let's say I have string literal as static C++ class member:
string Foo::abc = "ABC";
I'm exporting the class Foo. I'd like to export Foo::abc as well and be able to access it on Python side using similar interface: Foo.abc.
Can I do this using Boost.Python?
Sure, you just pass a pointer/ref to the static to def_readonly(). See the data_members test. -t
6001
Age (days ago)
6001
Last active (days ago)
1 comments
2 participants
participants (2)
-
Gennadiy Rozental -
troy d. straszheim