42, 52, 666. I see that we use the same magic dummy numbers 😁
Don't forget the const on the right-hand side!
Shouldn't we use auto instead of repeating the data type?
auto
#include <memory> int main() { const std::unique_ptr<const int> p = std::make_unique<const int>(42); const auto o = std::make_unique<const int>(51); static_assert(std::is_same_v<decltype(p), decltype(o)>); }
That's true, probably auto would be the best!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
42, 52, 666. I see that we use the same magic dummy numbers
😁
Shouldn't we use
auto
instead of repeating the data type?That's true, probably auto would be the best!