mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 16:23:02 +00: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
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user