#include <iostream>
#include <vector>

class A {
  public:
    std::vector<int>& get()
    {
      std::cout << "A::get()" << std::endl;
      return myVector;
    }
    const std::vector<int>& get() const
    {
      std::cout << "A::get() const" << std::endl;
      return myVector;
    }

  private:
    std::vector<int> myVector;
};

int main()
{
  A myA;
  myA.get().push_back(1);
  for (const auto& v: myA.get()) { } // it involve not const get method
  // force application to const instance
  std::cout << "use const reference to instance" << std::endl;
  { const A &myAC = myA;
    for (const auto& v: myAC.get()) { } // it involve not const get method
  }
  return 0;
}