fork(9) download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. struct Test {
  6. vector<float> _vector;
  7. const float& GetElement(size_t x) const {
  8. return _vector.at(x);
  9. }
  10. };
  11.  
  12. int main() {
  13. Test tst;
  14. tst._vector.push_back(123.456);
  15. cout << tst.GetElement(0) << endl;
  16. return 0;
  17. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
123.456