В cpp, как определить оператор[]= в классе [дубликат]C++

Программы на C++. Форум разработчиков
Anonymous
В cpp, как определить оператор[]= в классе [дубликат]

Сообщение Anonymous »

Я пробую следовать коду

Код: Выделить всё

#include "iostream"

class Cls {
public:
// Assume Cls has an array-like structure
int operator[](int idx) {
// Provide access to an element
std::cout 

Подробнее здесь: [url]https://stackoverflow.com/questions/78467132/in-cpp-how-to-def-operator-in-class[/url]

Вернуться в «C++»