mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 00:08:07 +02:00
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:
parent
0e151bcbf0
commit
96e06b2b06
1 changed files with 2 additions and 2 deletions
|
@ -23,14 +23,14 @@ public:
|
||||||
: p(r.p)
|
: p(r.p)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
explicit ref<T>(const std::shared_ptr<T> & p)
|
explicit ref(const std::shared_ptr<T> & p)
|
||||||
: p(p)
|
: p(p)
|
||||||
{
|
{
|
||||||
if (!p)
|
if (!p)
|
||||||
throw std::invalid_argument("null pointer cast to ref");
|
throw std::invalid_argument("null pointer cast to ref");
|
||||||
}
|
}
|
||||||
|
|
||||||
explicit ref<T>(T * p)
|
explicit ref(T * p)
|
||||||
: p(p)
|
: p(p)
|
||||||
{
|
{
|
||||||
if (!p)
|
if (!p)
|
||||||
|
|
Loading…
Reference in a new issue