====== Xdef_const ====== Xdef_const(name) XTAL_BINDマクロのスコープ内で呼び出すことでそのクラスの整数クラス定数//name//をバインドすることができます。別名でバインドしたい場合や整数以外をバインドしたい場合にはXdefを使ってください。 クラス定数やenum(といっても、enum専用の型になるわけではなくただの整数扱いです)のバインドに使います。というより、おそらくそれ以外に使えません。 ===== Example ===== ==== C++ ==== class Enum{ public: enum Type{ Type0, Type1, Type2, TypeMax }; }; XTAL_PREBIND(Enum){ } XTAL_BIND(Enum){ Xdef_const(Type0); Xdef_const(Type1); Xdef_const(Type2); Xdef_const(TypeMax); } void exec_xtal(){ xtal::global()->def(Xid(Enum), xtal::cpp_class()); Xsrc(( Enum::Type0.p; Enum::Type1.p; Enum::TypeMax.p; ))->call(); } ==== Output ==== 0 1 3