C++ Logo


Advanced search

Subject: Re: std::make_shared and type deduction
From: Kyle Knoepfel (kyleknoepfel_at_[hidden])
Date: 2020-07-10 14:57:33

If I were in control of the type, then sure, that could work. But Foo<T>
(from the original post) could represent any template (or type, for that
matter), which I don't necessarily have control over. For example, I can't
add new_p member functions to std::vector. The solution would be a free
function, and Thiago's suggested such names as
clone_unique(..)/clone_shared(..), which accurately describe the need.

STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups