libutil: remove template id from constructors

This is not allowed in C++20, and GCC 14 warns about it:

../src/libutil/ref.hh:26:20: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
   26 |     explicit ref<T>(const std::shared_ptr<T> & p)
      |                    ^
../src/libutil/ref.hh:26:20: note: remove the '< >'
../src/libutil/ref.hh:33:21: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
   33 |     explicit ref<T>(T * p)
      |                     ^
../src/libutil/ref.hh:33:21: note: remove the '< >'
This commit is contained in:
Pino Toscano 2024-07-28 11:31:28 +02:00
parent 0e151bcbf0
commit 96e06b2b06

View File

@ -23,14 +23,14 @@ public:
: p(r.p)
{ }
explicit ref<T>(const std::shared_ptr<T> & p)
explicit ref(const std::shared_ptr<T> & p)
: p(p)
{
if (!p)
throw std::invalid_argument("null pointer cast to ref");
}
explicit ref<T>(T * p)
explicit ref(T * p)
: p(p)
{
if (!p)