Re:C++14 and SDL2: Managing Resources
by pbsd on Friday April 18, 2014 @06:14PM
(#7611618)
The standard dictates that decltype(*r) deduces to T&, not T. The std::decay is there to collapse the reference type into a value type. Therefore your simplification results in a compilation error.
An alternative way to get the value type is to use std::remove_pointer_t:
using ResourceType = std::remove_pointer_t<decltype(c(args...))>;
An alternative way to get the value type is to use std::remove_pointer_t: