lilypond-devel
[Top][All Lists]
Advanced

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

Re: Add and use a Transform data type (issue 344970043 by address@hidden


From: Hans Åberg
Subject: Re: Add and use a Transform data type (issue 344970043 by address@hidden)
Date: Fri, 22 Jun 2018 10:49:36 +0200

> On 21 Jun 2018, at 00:30, address@hidden wrote:

>   Maybe a function would help:
> 
>    Transform make_transform(const Transform *t)
>      {
>        return t ? Transform (*t) : Transform ();
>      }
> 
> You could also do it as a constructor, if you prefer its syntax and
> don't mind implementing yet another one:
> 
>    explicit Transform(const Transform *t) ...

One can also use a tag type argument in the constructor:
  struct make_t {};
  constexpr make_t make{};

Used in the C++ library, cf.
  https://en.cppreference.com/w/cpp/utility/optional/nullopt_t





reply via email to

[Prev in Thread] Current Thread [Next in Thread]