私はwxWidgetsのと、他のC++コードスタイルでこれを見てきた:あなたは、いくつかの値を使用して直接クラスを使用する場合これをプログラミングする際の名前は何ですか?
#include <iostream>
class Foo {
int _x;
int _y;
public:
Foo() : _x(0), _y(0) {}
Foo (int x, int y) : _x(x), _y(y) {}
int get() const { return _x+_y; }
};
int GetFoo (const Foo& f) {
return f.get();
}
int main() {
Foo f1(2,3); // create object with values
std::cout << "Value1: " << f1.get() << '\n'; // access object method
std::cout << "Value2: " << GetFoo(Foo(3,7)) << '\n'; // How do you call this?
return 0;
}
です。私はという名前をオブジェクトとして直接クラスに渡しますが、プロパー用語を知りたいと思います。ありがとう。
参照渡し – AchmadJP