id
stringlengths
16
145
text
stringlengths
1
179k
title
stringclasses
1 value
C++_Classes_Templates/15079_262_0.txt
I think it would be better to optimize all "small" methods first and complex methods last, if you have an optimization time limit.
C++_Classes_Templates/1157_508_0.txt
0 replies
C++_Classes_Templates/Constexprlikekeyword_136_0.txt
This content, along with any associated source code and files, is licensed under [ The Code Project Open License (CPOL) ](http://www.codeproject.com/info/cpol10.aspx)
C++_Classes_Templates/1157_533_0.txt
This discussion was converted from issue #1157 on September 08, 2020 23:49.
C++_Classes_Templates/1157_367_0.txt
[ ![](https://avatars.githubusercontent.com/u/4564579?s=64&v=4) CyrusNajmabadi ](/CyrusNajmabadi) Dec 1, 2017
C++_Classes_Templates/15079_348_0.txt
Copy link
C++_Classes_Templates/1157_101_0.txt
Quote reply
C++_Classes_Templates/1157_97_0.txt
0 replies
C++_Classes_Templates/1157_135_0.txt
2 You must be logged in to vote
C++_Classes_Templates/15079_2_0.txt
Toggle navigation
C++_Classes_Templates/15079_425_0.txt
---
C++_Classes_Templates/15079_532_0.txt
All reactions
C++_Classes_Templates/1157_269_0.txt
4. Most if not all of the methods in the framework that are annotated with the ` Pure ` attribute are static, at least from what I've seen but I could be wrong, wouldn't be the first time but I agree with [ @GeirGrusom ](https://github.com/GeirGrusom) maybe it doesn't have to be so.
C++_Classes_Templates/C++_Classes_5_3.txt
nguage/access") [ Constructors and member initializer lists ](/w/cpp/language/constructor "cpp/language/constructor") [ Default member initializer ](/w/cpp/language/data_members#Member_initialization "cpp/language/data members") (C++11) [ ` friend ` specifier ](/w/cpp/language/friend "cpp/language/friend") [ ` ...
C++_Classes_Templates/15079_547_0.txt
[Calculator(Method.CubeVolume, 2)] const int cube = 0;
C++_Classes_Templates/15079_259_0.txt
**[ Unknown6656 ](/Unknown6656) ** commented Nov 10, 2016
C++_Classes_Templates/15079_123_0.txt
Copy link
C++_Classes_Templates/1157_462_0.txt
I'm pretty sure that this causes the feature to blow up out of all proportion and is probably not going to be implemented, but it's worth thinking about.
C++_Classes_Templates/172624_105_0.txt
std::ostream& operator<< ( std::ostream& stm, note n ) { static const char* const name_of[] { "A", "AS_BF", "B", "C", "CS_BF", "D", "DS_EF", "E", "F", "FS_GF", "G", "GS_AF" } ; return stm << name_of[n] ; }
C++_Classes_Templates/15079_413_0.txt
All reactions
C++_Classes_Templates/1157_251_0.txt
[ @GeirGrusom ](https://github.com/GeirGrusom)
C++_Classes_Templates/15079_511_0.txt
[ ![@asdfgasdfsafgsdfa](https://avatars.githubusercontent.com/u/3814727?s=80&u=af5b47eaaf9a7ded75c53369d7da673f8ca8d559&v=4) ](/asdfgasdfsafgsdfa)
C++_Classes_Templates/15079_88_0.txt
Sorry, something went wrong.
C++_Classes_Templates/172624_21_0.txt
> The easiest way I've found to implement this incorporates several arrays > whose values and sizes would always be constant > The largest array of this kind I would need would consist only of 12 > elements all storing chars.
C++_Classes_Templates/15079_347_0.txt
[ ![@iam3yal](https://avatars.githubusercontent.com/u/3756641?s=80&u=b853037d90aa1b20e6864477d91be927aeed062c&v=4) ](/iam3yal)
C++_Classes_Templates/1157_359_0.txt
1 You must be logged in to vote
C++_Classes_Templates/15079_466_0.txt
[ ![@RandyBuchholz](https://avatars.githubusercontent.com/u/13967891?s=80&v=4) ](/RandyBuchholz)
C++_Classes_Templates/1157_456_0.txt
> An interesting example that came up on roslyn repo is when you're using an > impure type like StringBuilder
C++_Classes_Templates/15079_736_0.txt
[ Support C#7 tuples as default values for optional parameters #16921 ](/dotnet/roslyn/issues/16921)
C++_Classes_Templates/C++_Classes_7_0.txt
##### [ cppreference.com ](/) [ Log in ](/mwiki/index.php?title=Special:UserLogin&returnto=cpp%2Flanguage%2Fstatic "You are encouraged to log in; however, it is not mandatory \[o\]") ##### Namespaces * [ Page ](/w/cpp/language/static "View the content page \[c\]") * [ Discussion ](/w/Talk:cpp/language/static "...
C++_Classes_Templates/C++_Classes_5_5.txt
as inherited is initialized using the inherited constructor, and all other bases and members of ` Derived ` are initialized as if by the defaulted default constructor (default member initializers are used if provided, otherwise default initialization takes place). The entire initialization is treated as a single functi...
C++_Classes_Templates/15079_602_0.txt
edited
C++_Classes_Templates/C++_Classes_4_3.txt
tructors and member initializer lists ](/w/cpp/language/constructor "cpp/language/constructor") [ Default member initializer ](/w/cpp/language/data_members#Member_initialization "cpp/language/data members") (C++11) [ ` friend ` specifier ](/w/cpp/language/friend "cpp/language/friend") [ ` explicit ` specifier ](/...
C++_Classes_Templates/15079_399_0.txt
All reactions
C++_Classes_Templates/15079_173_0.txt
**[ iam3yal ](/iam3yal) ** commented Nov 8, 2016
C++_Classes_Templates/15079_657_0.txt
Copy link
C++_Classes_Templates/1157_147_0.txt
Why does pure functions have to be static? The only extra thing to consider is that any base call also has to be pure.
C++_Classes_Templates/15079_517_0.txt
> One of the examples used a few times is a real limitation in the language - > Attribute parameter values. Since they want const or similar "defined as > known values" arguments, not just "known values", or "knowable values".
C++_Classes_Templates/15079_226_0.txt
###
C++_Classes_Templates/15079_703_0.txt
---
C++_Classes_Templates/15079_367_0.txt
**[ TonyValenti ](/TonyValenti) ** commented Nov 11, 2016
C++_Classes_Templates/1157_217_0.txt
[ @DavidArno ](https://github.com/DavidArno)
C++_Classes_Templates/15079_695_0.txt
Sorry, something went wrong.
C++_Classes_Templates/15079_653_0.txt
---
C++_Classes_Templates/15079_300_0.txt
👍 2 iam3yal and s341507 reacted with thumbs up emoji
C++_Classes_Templates/15079_671_0.txt
All reactions
C++_Classes_Templates/15079_544_0.txt
However, I really think that you guys speak about some sort of code generation + macros whereas I speak mainly about calculation.
C++_Classes_Templates/15079_629_0.txt
* 👍 1 reaction
C++_Classes_Templates/1157_138_0.txt
* 👍 13
C++_Classes_Templates/1157_288_0.txt
9 hidden items Load more…
C++_Classes_Templates/1157_416_0.txt
---
C++_Classes_Templates/15079_82_0.txt
###
C++_Classes_Templates/1157_425_0.txt
###
C++_Classes_Templates/15079_96_0.txt
All reactions
C++_Classes_Templates/172624_78_0.txt
return result ; }
C++_Classes_Templates/Constexprlikekeyword_157_0.txt
Copyright © [ CodeProject ](mailto:webmaster@codeproject.com) , 1999-2024 All Rights Reserved.
C++_Classes_Templates/1157_341_0.txt
The rules of how the IL gets executed are fairly explicit and shouldn't have inputs/outputs differing between runtimes or hosts.
C++_Classes_Templates/Constexprlikekeyword_113_0.txt
YAML
C++_Classes_Templates/1157_501_0.txt
To sum up, this whole discussion about perfect pureness is counterproductive to real-world use cases. Simply having ` const ` from C++ is enough to solve most problems. Even though ` const ` is a huge part of the C++ type system, so C# would also need to decorate parameters as ` const ` . Only newer languages have real...
C++_Classes_Templates/15079_420_0.txt
**[ iam3yal ](/iam3yal) ** commented Jan 30, 2017 •
C++_Classes_Templates/Constexprlikekeyword_23_0.txt
![](https://www.codeproject.com/script/Ratings/Images/star-empty-md.png)
C++_Classes_Templates/1157_419_0.txt
All reactions
C++_Classes_Templates/1157_557_0.txt
You can’t perform that action at this time.
C++_Classes_Templates/C++_Classes_1_1.txt
function expression ](/w/cpp/language/lambda "cpp/language/lambda") [ ` inline ` specifier ](/w/cpp/language/inline "cpp/language/inline") [ Dynamic exception specifications ](/w/cpp/language/except_spec "cpp/language/except spec") ( until C++17* ) [ ` noexcept ` specifier ](/w/cpp/language/noexcept_spec "cpp/l...
C++_Classes_Templates/172624_81_0.txt
---|---
C++_Classes_Templates/15079_353_0.txt
> Someone on here mentioned that compile times would increase. While that is > true, decreasing run times has more value to end users. I think that, > ideally, things should be "more pre-evaluated" as I go from Debug to > Release. Who cares if my build server takes 1 hour to do a compile if it > saves my users time?
C++_Classes_Templates/15079_621_0.txt
> I proposed to add the const modifier to methods that can be evaluated at > compile-time and have specific rules around it. > > Methods that are marked with cost can still be evaluated at run-time if > either one of their arguments isn't a constant. > > I also think and wrote that more types should be supported by con...
C++_Classes_Templates/15079_323_0.txt
[ ![@iam3yal](https://avatars.githubusercontent.com/u/3756641?s=80&u=b853037d90aa1b20e6864477d91be927aeed062c&v=4) ](/iam3yal)
C++_Classes_Templates/Constexprlikekeyword_10_0.txt
[ ![](https://pubads.g.doubleclick.net/gampad/jump?iu=/6839/lqm.codeproject.site/ros&sz=728x90&c=564061) ](https://pubads.g.doubleclick.net/gampad/jump?iu=/6839/lqm.codeproject.site/ros&sz=728x90&c=564061)
C++_Classes_Templates/15079_320_0.txt
---
C++_Classes_Templates/172624_83_0.txt
Last edited on Sep 3, 2015 at 4:14am UTC
C++_Classes_Templates/C++_Classes_5_2.txt
ration ](/w/cpp/language/type_alias "cpp/language/type alias") (C++11) Casts [ Implicit conversions ](/w/cpp/language/implicit_conversion "cpp/language/implicit conversion") \- [ Explicit conversions ](/w/cpp/language/explicit_cast "cpp/language/explicit cast") [ ` static_cast ` ](/w/cpp/language/static_cast "cpp...
C++_Classes_Templates/1157_226_0.txt
👍 3
C++_Classes_Templates/15079_763_0.txt
Sorry, something went wrong.
C++_Classes_Templates/1157_332_0.txt
Comment options
C++_Classes_Templates/Constexprlikekeyword_146_0.txt
[ Understanding conditional inclusions vs constexpr ](//www.codeproject.com/Questions/5323106/Understanding-conditional- inclusions-vs-constexpr)
C++_Classes_Templates/15079_207_0.txt
edited
C++_Classes_Templates/15079_564_0.txt
###
C++_Classes_Templates/1157_5_0.txt
* Product
C++_Classes_Templates/15079_228_0.txt
edited
C++_Classes_Templates/1157_377_0.txt
# {{title}}
C++_Classes_Templates/172624_53_0.txt
//iterating through all notes auto current_it = notes.begin(); const auto last_it = notes.end();
C++_Classes_Templates/1157_219_0.txt
I think these two concepts are fairly similar, but we need to annotate a whole bunch of operators/members for it to be actually useful. For example built-in operators on primitives are all both pure and constexpr.. As an example ` int Member() => readonlyField + 1; ` is pure but can't be constexpr because we don't have...
C++_Classes_Templates/15079_474_0.txt
const int x = 5; const int y = 6; var v = x + y;
C++_Classes_Templates/15079_676_0.txt
###
C++_Classes_Templates/15079_287_0.txt
All reactions
C++_Classes_Templates/Constexprlikekeyword_74_0.txt
## Add your solution here
C++_Classes_Templates/15079_776_0.txt
Assignees
C++_Classes_Templates/15079_463_0.txt
All reactions
C++_Classes_Templates/172624_22_0.txt
An array is perfectly fine if the size is a constant known at compile time.
C++_Classes_Templates/15079_534_0.txt
Sorry, something went wrong.
C++_Classes_Templates/15079_62_0.txt
Copy link
C++_Classes_Templates/1157_242_0.txt
1 You must be logged in to vote
C++_Classes_Templates/1157_209_0.txt
* 👍 1
C++_Classes_Templates/15079_275_0.txt
[ @eyalsk ](https://github.com/eyalsk) Constants expressions is not just about the compiler. When you have a JIT a constant expression at the JIT level behaves in the same way as a constant expression at the Compiler level. For example, pointer size. When you are JITting you know for sure and can act accordingly. So a ...
C++_Classes_Templates/15079_436_0.txt
I have an app that contains an embedded license file to use a third-party library. The license file has an expiration date in it and every so often we have to update the license file. I want to build a class that will read the embedded resource and let me access certain properties on it. Ideally, it would be a compile ...
C++_Classes_Templates/Constexprlikekeyword_91_0.txt
Javascript
C++_Classes_Templates/15079_481_0.txt
I proposed the scope as - "The language shall provide the user with the ability to assign the results of the evaluation of any construct (object or expression), that can be evaluated to "values", at compile time, using the information available within the assembly, into a const."
C++_Classes_Templates/15079_740_0.txt
Contributor
C++_Classes_Templates/1157_411_0.txt
[ ![](https://avatars.githubusercontent.com/u/4979268?s=64&v=4) GeirGrusom ](/GeirGrusom) Dec 1, 2017