/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/operator_pointer_ref.i
29 строк
526 B
Seth R Johnson
"Include what you use" for tests
06 янв 2019, 16:32
06 янв 2019, 16:32
feeb251
Код
Авторство
О чём код?
%module operator_pointer_ref %{ #if defined(_MSC_VER) #pragma warning(disable: 4996) // 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details. #endif #include <string.h> #include <stdlib.h> %} %rename(AsCharStarRef) operator char*&; %inline %{ class MyClass { public: MyClass (const char *s_ = "") : s(strdup(s_ ? s_ : "")) { } ~MyClass () { free(s); } operator char*&() { return s; } private: char *s; }; %}