Can we use  operator or ++ with unique pointer or shared_pointer? As we use it for raw pointer
int * a = new int;
a = 2; // We can use  operator;
operatorprovides access to elements of an array managed by a
std::unique_ptr<int> a(new int); a = 2; // We can use  operator;
Note the index shall be less than the number of elements in the array; otherwise, the behavior is undefined.
And I'll suggest you to use
std::array if you just want an array.