Printing shortest decimal form of floating point number with Mir

9il ilyayaroshenko at gmail.com
Thu Dec 24 11:44:35 UTC 2020


On Thursday, 24 December 2020 at 11:05:16 UTC, Ola Fosheim 
Grøstad wrote:
> On Wednesday, 23 December 2020 at 20:56:26 UTC, jmh530 wrote:
>> [...]
>
> Non-concept version is more verbose, but yeah, works fine in 
> C++17:
>
> namespace detail {
>     template<template<typename> class F, class U>
>     static constexpr void _dummy(const F<U> &a);
>
>     template<class T, template<typename> typename F, class=void>
>     struct has_outer_template : std::false_type {};
>
>     template<class T, template<typename> typename F>
>     struct 
> has_outer_template<T,F,std::void_t<decltype(_dummy<F>(std::declval<T&>()))>>: std::true_type {};
> };
>
> template <class T, template<typename> typename F>
> inline constexpr bool has_outer_template = 
> detail::has_outer_template<T,F>::value;
>
> template<class T>
> struct Foo{};
>
> static_assert(has_outer_template<Foo<int>,Foo>);

Thank you for the examples. They make sense.


More information about the Digitalmars-d-announce mailing list