Код: Выделить всё
struct A
{
std::string name;
// other members
};
struct B
{
std::string name;
// different members
};
class Table
{
private:
std::vector vec1;
std::vector vec2;
};
< /code>
Какой был бы правильный способ иметь: < /p>
int Foo(const std::vector ¶m, bool isB)
{
};
< /code>
Где будет фактический вызов: < /p>
auto result = Foo( vec1, false );
< /code>
или < /p>
auto result = Foo( vec2, true );
или есть лучший способ?
Подробнее здесь: https://stackoverflow.com/questions/797 ... -this-case
Мобильная версия