Код: Выделить всё
// declspec_property.cpp
struct S {
int i;
void putprop(int j) {
i = j;
}
int getprop() {
return i;
}
__declspec(property(get = getprop, put = putprop)) int the_prop;
};
int main() {
S s;
s.the_prop = 5;
return s.the_prop;
}
Если я ищу __declspec, все, что я нахожу, это __declspec(dllexport ), но я этого не ищу.
Подробнее здесь: https://stackoverflow.com/questions/580 ... n-attribut
Мобильная версия