Re: Long compile times due mangling of return types in function templates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26 April 2015 at 11:05, Avi Kivity wrote:
> @@ -526,12 +527,14 @@ public:
>      }
>       template <typename Func>
> -    futurize_t<std::result_of_t<Func(T&&...)>> then(Func&& func) noexcept {
> +    auto // futurize_t<std::result_of_t<Func(T&&...)>>
> +    then(Func&& func) noexcept {
>          return

This changes the meaning of the code. For the original the function
will not participate in overload resolution when
result_of_t<Func(T&&...)> is not a valid type. You have changed that
so the function can be called with invalid types and might be chosen
by overload resolution, resulting in a compiler error.

So feel free to do that in your own code if you want to avoid the
compile-time overhead of SFINAE, but there are very good reasons it
shouldn't be done in general.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux