Answer the question
In order to leave comments, you need to log in
How to pass an array to a constructor?
Good evening, this is not what you think! I know about new[] =)
I'm doing my simple implementation of smart pointers for c++98. But I can't make a pointer to an array.
my::smart_ptr<int[]> arrN1(new int[10]); // ошибка: now matching constructor for initialization of "my::smart_ptr<int[]>
std::unique_ptr<int[]> arrN2(new int[10]);
smart_ptr(int[] t) {};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question