Home » Community » U++ community news and announcements » get_i
Re: get_i [message #54260 is a reply to message #54256] |
Tue, 16 June 2020 22:15   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Tue, 16 June 2020 15:20
However, constexpr I still do not agree. Following your logic, we should add constexpr to every single function everywhere - these are as likely to have constant parameters as get_i (which has like 0.00000001% chance that first parameter will be const in real code).
You cannot add constexpr to every single function everywhere. There are restrictions ...
But, IMHO, function, which can be compiled with constexpr, should have it ...
At this time you are not using functions in compile-time context because you just cannot do that.
I personally often write code like this:
enum e {
e01 = 1,
e02 = 100,
e03 = e01 + e02
};
In case of constexpr functions I'll be able to write this:
enum e {
e01 = min(something, something_else),
e02 = max(something, something_else)
};
Another observation: template functions/methods are inline by default.
Regards,
Novo
|
|
|
 |
|
get_i
By: mirek on Sun, 14 June 2020 19:10
|
 |
|
Re: get_i
By: Novo on Tue, 16 June 2020 17:45
|
 |
|
Re: get_i
By: mirek on Tue, 16 June 2020 17:52
|
 |
|
Re: get_i
By: Novo on Tue, 16 June 2020 18:02
|
 |
|
Re: get_i
By: Novo on Tue, 16 June 2020 18:21
|
 |
|
Re: get_i
By: mirek on Tue, 16 June 2020 21:20
|
 |
|
Re: get_i
By: Novo on Tue, 16 June 2020 22:15
|
 |
|
Re: get_i
By: mirek on Wed, 17 June 2020 00:01
|
 |
|
Re: get_i
By: Novo on Wed, 17 June 2020 07:01
|
 |
|
Re: get_i
By: Novo on Wed, 17 June 2020 07:09
|
 |
|
Re: get_i
By: Novo on Wed, 17 June 2020 07:23
|
 |
|
Re: get_i
By: Novo on Wed, 17 June 2020 07:50
|
 |
|
Re: get_i
By: mirek on Wed, 17 June 2020 09:35
|
 |
|
Re: get_i
By: mirek on Wed, 17 June 2020 13:03
|
 |
|
Re: get_i
By: Novo on Wed, 17 June 2020 19:00
|
 |
|
Re: get_i
By: Novo on Wed, 17 June 2020 19:14
|
 |
|
Re: get_i
By: mirek on Wed, 17 June 2020 21:03
|
 |
|
Re: get_i
By: Novo on Wed, 17 June 2020 23:21
|
 |
|
Re: get_i
By: Novo on Wed, 17 June 2020 23:59
|
 |
|
Re: get_i
By: mirek on Thu, 18 June 2020 08:39
|
 |
|
Re: get_i
By: Novo on Thu, 18 June 2020 23:56
|
 |
|
Re: get_i
By: Novo on Tue, 16 June 2020 21:22
|
 |
|
Re: get_i
By: mirek on Tue, 16 June 2020 21:25
|
 |
|
Re: get_i
By: Novo on Tue, 16 June 2020 21:42
|
 |
|
Re: get_i
By: Novo on Wed, 17 June 2020 06:39
|
 |
|
Re: get_i
By: mirek on Mon, 29 June 2020 19:23
|
 |
|
Re: get_i
By: Novo on Thu, 02 July 2020 22:08
|
 |
|
Re: get_i
By: mirek on Fri, 03 July 2020 09:38
|
 |
|
Re: get_i
By: Novo on Fri, 03 July 2020 18:53
|
 |
|
Re: get_i
By: mirek on Fri, 03 July 2020 19:03
|
Goto Forum:
Current Time: Wed Apr 30 01:05:34 CEST 2025
Total time taken to generate the page: 0.00413 seconds
|