C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: 2 big problems with User Defined literals:
From: Andy Little (kwikius_at_[hidden])
Date: 2021-05-18 06:05:36


 

    On Tuesday, 18 May 2021, 00:11:15 BST, Jason Cobb via Std-Discussion <std-discussion_at_[hidden]> wrote:
 
 On 5/17/21 7:05 PM, Andy Little via Std-Discussion wrote:
>
>
> int main()
> {
>    auto a = std::chrono::milliseconds{5};
>    auto b = a + a;  //this works fine
>    auto c = a + 5ns; // so why not this?
> }
>

If this is possible, what should decltype(5ns) be?
That depends on the context, but this would clear things up:
decltype(pqs::si::5ns)decltype(std::literals::5ns)
kwikius/pqs

|
|
|
| | |

 |

 |
|
| |
kwikius/pqs

C++ Physical Quantities System. Contribute to kwikius/pqs development by creating an account on GitHub.
 |

 |

 |

Std-Discussion mailing list
Std-Discussion_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion
  



STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups