Search
Duplicate
👡

.cpp 파일에서의 C++/CLI property, indexer syntax

Category
S/W 엔지니어
Tags
C++
C++/CLI
Created time
2007/07/06
원문은 이곳에서..
다음은 header의 선언부.
using namespace System; public ref class Test { long mValue; array<long>^ mValues; public: Test() {} property long noindex { void set(long); long get(); } property long indexed[int] { void set(int,long); long get(int); } };
C++
복사
위 선언부에 대한 정의는..
long Test::noindex::get() { return mValue; } void Test::noindex::set(long value) { mValue = 0; } long Test::indexed::get(int index) { return mValues[index]; } void Test::indexed::set(int index, long value) { mValues[index] = value; }
C++
복사