id
stringlengths
16
145
text
stringlengths
1
179k
title
stringclasses
1 value
C++_Classes_Templates/15079_752_0.txt
[ ![@iam3yal](https://avatars.githubusercontent.com/u/3756641?s=80&u=b853037d90aa1b20e6864477d91be927aeed062c&v=4) ](/iam3yal)
C++_Classes_Templates/172624_18_0.txt
I had other questions about the use of chars but... it appears I've written a novel haha, so I'll leave it at this for now. But thanks in advance to anyone who takes the time to read and/or respond to this!
C++_Classes_Templates/1157_26_0.txt
[ Search syntax tips ](https://docs.github.com/search-github/github-code- search/understanding-github-code-search-syntax)
C++_Classes_Templates/15079_256_0.txt
[ ![@Unknown6656](https://avatars.githubusercontent.com/u/8807985?s=80&u=0b85316fdb479595b2731ec5e1ab0d8c03bb3609&v=4) ](/Unknown6656)
C++_Classes_Templates/15079_31_0.txt
# Saved searches
C++_Classes_Templates/15079_588_0.txt
[ ![@RandyBuchholz](https://avatars.githubusercontent.com/u/13967891?s=80&v=4) ](/RandyBuchholz)
C++_Classes_Templates/15079_355_0.txt
> I think that only pure functions should be able to be const.
C++_Classes_Templates/Constexprlikekeyword_5_0.txt
Password
C++_Classes_Templates/172624_57_0.txt
[ **JLBorges** (13770) ](/user/JLBorges/)
C++_Classes_Templates/1157_491_0.txt
class Ship { Universe* Owner; // Ships have access to Universe public: // does Draw use Owner to cause side effects?? what about other member fields?? // No way to tell unless you examine hundreds of lines of code void Draw() { ... } };
C++_Classes_Templates/15079_490_0.txt
###
C++_Classes_Templates/15079_715_0.txt
Don't think "let's keep it from doing x".
C++_Classes_Templates/15079_738_0.txt
[ ![@jrmoreno1](https://avatars.githubusercontent.com/u/13475296?s=80&v=4) ](/jrmoreno1)
C++_Classes_Templates/15079_235_0.txt
To tell/hint the compiler, how much time it should use/"waste" for precompilation.
C++_Classes_Templates/15079_195_0.txt
* * *
C++_Classes_Templates/172624_34_0.txt
![](/img/link.png) Sep 2, 2015 at 8:12pm UTC
C++_Classes_Templates/1157_227_0.txt
All reactions
C++_Classes_Templates/15079_622_0.txt
Firsly, I prefer ` pure ` because ` const ` function returns one single value by definition. ` pure ` describes intention of function, ` const ` describes that you want to inline result somewhere. Function call site is not its area of responsability so it shouldn't assume if it will be constant or not. It just saying `...
C++_Classes_Templates/1157_333_0.txt
# {{title}}
C++_Classes_Templates/1157_379_0.txt
Quote reply
C++_Classes_Templates/15079_557_0.txt
However, I can live with the source generator approach and maybe in the future I'd implement a prototype and then write a proposal for this myself because I have a plan! :)
C++_Classes_Templates/Constexprlikekeyword_109_0.txt
Terminal
C++_Classes_Templates/15079_632_0.txt
Copy link
C++_Classes_Templates/1157_502_0.txt
---
C++_Classes_Templates/15079_102_0.txt
[ @eyalsk ](https://github.com/eyalsk)
C++_Classes_Templates/1157_457_0.txt
That's a pretty tricky case, because we need to introduce two new concepts--in addition to _pure_ .
C++_Classes_Templates/1157_38_0.txt
[ Sign up ](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser- name%3E%2F%3Crepo- name%3E%2Fvoltron%2Fdiscussions_fragments%2Fdiscussion_layout&source=header- repo&source_repo=dotnet%2Fcsharplang)
C++_Classes_Templates/15079_522_0.txt
Sorry, something went wrong.
C++_Classes_Templates/15079_565_0.txt
**[ RandyBuchholz ](/RandyBuchholz) ** commented Jan 30, 2017 •
C++_Classes_Templates/15079_392_0.txt
[ ![@iam3yal](https://avatars.githubusercontent.com/u/3756641?s=80&u=b853037d90aa1b20e6864477d91be927aeed062c&v=4) ](/iam3yal)
C++_Classes_Templates/1157_529_0.txt
None yet
C++_Classes_Templates/15079_49_0.txt
By clicking “Sign up for GitHub”, you agree to our [ terms of service ](https://docs.github.com/terms) and [ privacy statement ](https://docs.github.com/privacy) . We’ll occasionally send you account related emails.
C++_Classes_Templates/15079_659_0.txt
###
C++_Classes_Templates/172624_59_0.txt
No. The standard library iterators and algorithms (STL is a misnomer) work equally well on c-style arrays: a raw pointer is a random access iterator.
C++_Classes_Templates/1157_315_0.txt
👍 1
C++_Classes_Templates/15079_658_0.txt
Author
C++_Classes_Templates/15079_61_0.txt
[ ![@iam3yal](https://avatars.githubusercontent.com/u/3756641?s=80&u=b853037d90aa1b20e6864477d91be927aeed062c&v=4) ](/iam3yal)
C++_Classes_Templates/1157_184_0.txt
# {{title}}
C++_Classes_Templates/15079_165_0.txt
**Templates** and **Macros** have previously been brought up and respectively declined by the language design teams. [ #14619 ](https://github.com/dotnet/roslyn/issues/14619)
C++_Classes_Templates/15079_537_0.txt
Author
C++_Classes_Templates/1157_451_0.txt
Something went wrong.
C++_Classes_Templates/1157_180_0.txt
All reactions
C++_Classes_Templates/15079_225_0.txt
Copy link
C++_Classes_Templates/1157_7_0.txt
Explore
C++_Classes_Templates/15079_741_0.txt
###
C++_Classes_Templates/1157_505_0.txt
👍 3
C++_Classes_Templates/1157_307_0.txt
###
C++_Classes_Templates/15079_403_0.txt
###
C++_Classes_Templates/C++_Classes_1_2.txt
uage/typedef "cpp/language/typedef") [ Type alias declaration ](/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...
C++_Classes_Templates/1157_165_0.txt
1 You must be logged in to vote
C++_Classes_Templates/1157_327_0.txt
---
C++_Classes_Templates/1157_174_0.txt
[ @DavidArno ](https://github.com/DavidArno)
C++_Classes_Templates/Constexprlikekeyword_32_0.txt
and I can check in the main to ensure the function is correct by doing something like:
C++_Classes_Templates/15079_586_0.txt
All reactions
C++_Classes_Templates/1157_477_0.txt
That is similar to my thoughts. "Ownership" is a good term. If a type has local mutation only (ie mutates only its own state) and the scope of an instance of that type is confined to the method (ie, the method owns that instance) and its final output before going out of scope is an immutable "value", then that method c...
C++_Classes_Templates/15079_50_0.txt
Already on GitHub? [ Sign in ](/login?return_to=%2Fdotnet%2Froslyn%2Fissues%2Fnew%2Fchoose) to your account
C++_Classes_Templates/1157_62_0.txt
Disadvantage:
C++_Classes_Templates/1157_193_0.txt
1 You must be logged in to vote
C++_Classes_Templates/1157_252_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/C++_Classes_6_4.txt
i int i; };   struct Derived3 : Base { Derived1 c; // derived from Base, occupies sizeof(int) bytes int i; };   int main() { // empty base optimization does not apply, // base occupies 1 byte, Base member occupies 1 byte // followed by 2 by...
C++_Classes_Templates/Constexprlikekeyword_69_0.txt
[ Thomas Daniels ](/script/Membership/View.aspx?mid=8966127)
C++_Classes_Templates/15079_526_0.txt
**[ TonyValenti ](/TonyValenti) ** commented Jan 30, 2017 via email
C++_Classes_Templates/15079_630_0.txt
Sorry, something went wrong.
C++_Classes_Templates/15079_330_0.txt
1. Behaviour of existing code may change so this is a breaking change. 2. If the assumption is such that all functions can be evaluated at compile time then compilation times will increase, greatly. 3. If we wouldn't have to mark functions with ` constexpr ` or any other keyword then we wouldn't be able to make it _saf...
C++_Classes_Templates/1157_394_0.txt
###
C++_Classes_Templates/15079_484_0.txt
👍 4 jnm2, iam3yal, magol, and SrirachaSource reacted with thumbs up emoji
C++_Classes_Templates/1157_121_0.txt
All reactions
C++_Classes_Templates/1157_69_0.txt
All reactions
C++_Classes_Templates/1157_443_0.txt
_pure_ interface method could solve this issue.
C++_Classes_Templates/C++_Classes_3_5.txt
foo() const { // x = 7; // Error: *this is constant }   void foo(int x) // parameter x shadows the member with the same name { this->x = x; // unqualified x refers to the parameter // 'this->' required for disambiguation }   ...
C++_Classes_Templates/15079_182_0.txt
[ ![@gafter](https://avatars.githubusercontent.com/u/3804346?s=40&u=8850d3c6d4882e713ad377d2e2fe09dd94e42af0&v=4) ](/gafter) [ gafter ](/gafter) added [ Discussion ](/dotnet/roslyn/labels/Discussion) [ Area-Language Design ](/dotnet/roslyn/labels/Area-Language%20Design) labels Nov 8, 2016
C++_Classes_Templates/15079_648_0.txt
###
C++_Classes_Templates/15079_124_0.txt
Contributor
C++_Classes_Templates/1157_249_0.txt
###
C++_Classes_Templates/1157_300_0.txt
2 You must be logged in to vote
C++_Classes_Templates/15079_573_0.txt
[Attribute([Enum not enum])] public class Worker{}
C++_Classes_Templates/172624_69_0.txt
template < std::size_t N > using scale = std::array<note,N> ;
C++_Classes_Templates/1157_362_0.txt
Comment options
C++_Classes_Templates/15079_500_0.txt
[ @CyrusNajmabadi ](https://github.com/CyrusNajmabadi) Well _if_ code generators allow us to replace a property completely (how get, set, and initializer are implemented) then the whole point is moot and the feature is useless. Because then we can simply use them to execute our code and generate new code to be compiled...
C++_Classes_Templates/Constexprlikekeyword_105_0.txt
Shell
C++_Classes_Templates/15079_46_0.txt
New issue
C++_Classes_Templates/15079_280_0.txt
Copy link
C++_Classes_Templates/15079_514_0.txt
**[ asdfgasdfsafgsdfa ](/asdfgasdfsafgsdfa) ** commented Jan 30, 2017 •
C++_Classes_Templates/1157_186_0.txt
Quote reply
C++_Classes_Templates/15079_231_0.txt
I think the pre-processor should build a caller tree to sort the methods by complexity and recursion depth. It should then optimize the less complex methods first, and then move onto the more complex ones. I have no idea, which should be the complexity "limit", but it will be dependent from the method size.
C++_Classes_Templates/Constexprlikekeyword_104_0.txt
Scala
C++_Classes_Templates/C++_Classes_3_0.txt
##### [ cppreference.com ](/) [ Log in ](/mwiki/index.php?title=Special:UserLogin&returnto=cpp%2Flanguage%2Fthis "You are encouraged to log in; however, it is not mandatory \[o\]") ##### Namespaces * [ Page ](/w/cpp/language/this "View the content page \[c\]") * [ Discussion ](/mwiki/index.php?title=Talk:cpp/l...
C++_Classes_Templates/172624_62_0.txt
That would still be, by far, the best approach. Strongly favour range-based loops over classical loops. [ http://www.stroustrup.com/C++11FAQ.html#for ](http://www.stroustrup.com/C++11FAQ.html#for)
C++_Classes_Templates/172624_46_0.txt
const char * letterName[12]; "other array" [12];
C++_Classes_Templates/15079_635_0.txt
edited
C++_Classes_Templates/15079_677_0.txt
**[ iam3yal ](/iam3yal) ** commented Jan 30, 2017
C++_Classes_Templates/172624_58_0.txt
> The reason to use std::array and std::vector is the use of STL.
C++_Classes_Templates/15079_292_0.txt
**[ redknightlois ](/redknightlois) ** commented Nov 10, 2016
C++_Classes_Templates/15079_365_0.txt
Copy link
C++_Classes_Templates/Constexprlikekeyword_102_0.txt
Razor
C++_Classes_Templates/15079_147_0.txt
[ @eyalsk ](https://github.com/eyalsk) One issue I see with it is the example you reference uses **templates** . _Touchy Subject_
C++_Classes_Templates/15079_451_0.txt
Copy link
C++_Classes_Templates/15079_393_0.txt
Copy link
C++_Classes_Templates/1157_229_0.txt
0 replies
C++_Classes_Templates/15079_38_0.txt
[ Sign up ](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser- name%3E%2F%3Crepo- name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header- repo&source_repo=dotnet%2Froslyn)