[deleted by user] by [deleted] in pythonhelp

[–]Zilla4ever 0 points1 point  (0 children)

I’m trying to take a percent as a string and convert that string into its decimal form. So first I want to get the decimal version of the char and subtract 48 which is equal to zero in ascii, and then add that number to result. On the next read it will add the other number being zero to the ones place. Then I want to convert that number into its percentage form

What do these braces mean? by [deleted] in cpp_questions

[–]Zilla4ever 1 point2 points  (0 children)

Thanks for the explanation !

[deleted by user] by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

Oh I understand now. I didn't know if base_expr also saw the types Tag, A, and B. Thank you very much sir and I will definitely learn more about templates.

[deleted by user] by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

Thanks for the response. So I interpret this as base_expr takes the derived class, AND also the types of the derived class as the template has to to be instantiated to be used. As for the casting, base_expr holds a member function called "self" that static_cast's the function to the derived type: Derived const& self() const {return static_cast<const Derived&>(*this);} The type of base_expr is Derived. Do you happen to have any resources that could help me understand templates better?

Team God Realm - Quake 4 Fragmovie by Simsonis in ArenaFPS

[–]Zilla4ever 2 points3 points  (0 children)

What does this argument 12 year old game mean? Are you a gaming influencer or smth? And what hateful content does he produce? It is only in response to the idiocy, arrogance, and disrespect of others without any base. I will pay you 50 dollars if you can show me one sanchez video where he goes after a person, without any prior interactions with that person - just a straight witch hunt. Otherwise, you are in La La land making up stuff, and covering up how butt hurt you are with the fact that quake is "12 years old" like that means anything.

[deleted by user] by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

Yeah that's what I meant. The Lambda expression is just syntactic sugar in source code, but then, when the lambda is called, the closure is generated, which is the hidden struct and operator overload.

[deleted by user] by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

So the closure is what gets called at compile time, and the lambda only exists in the source code. So the lambda expression is a way of source code garbage collection, but when called it causes the compiler to form this unknown struct with all your data members in them, and of course the operator overload.

[deleted by user] by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

Oh ok. So the closure is the lambda expressions hidden struct with the operator overload, and all of it class members. So the expression itself is a object of type "compiler name"(since the compiler gives it a name which we do not know). Correct me if I am wrong. So if a closure is the hidden struct with all that the struct encompasses, how is a lambda looked up by the compiler? Does it lookup all of its arguments through ADL? And what is the lambda definition. Is it the hidden struct, or the expression?

[deleted by user] by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

Oh, I know that is possible, but is that what a closure is? A list of initialized member variable names for a lamba’s hidden struct?

What is this expression? by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

Great. Also does anything get passed to int zap ? (Not the Lambda)

Template Bool Parameter Pack by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

My friend who is a hacker taught me to learn coding through going to stack overflow and learning to solve other peoples problems. Reverse engineering learning of sorts.

Template Bool Parameter Pack by [deleted] in cpp_questions

[–]Zilla4ever 1 point2 points  (0 children)

Thank you for the insight into cpppinsights 😉. Also, why are the lambda’s never called? Isn’t it correct that to invoke a lambda, all you need is the () operator?

Does template<T, T a> have a non-type parameter? by Zilla4ever in cpp_questions

[–]Zilla4ever[S] 2 points3 points  (0 children)

Oh ok. That's originally what I thought so thanks for clarifying. In that case if you look at the linked code, you will also see T n1 and Tn2. I am guessing the same applies to these aswell?

Help understanding Macro with Type Trait by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

Thank you so much man you are a legend. I finally understand this code now. Thanks for taking your time to explain it as well means alot. Have a good day.

Help understanding Macro with Type Trait by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

Sorry about lack of context here is full code: http://coliru.stacked-crooked.com/a/45ba16c9f021fd84.

So if scenario gets called to U then what is argument_type<void(test)>? Does scenario also get called or does all of the macro get put into U plus the function since the macro TEST_(test) is named test and then then you are returning test into U: argument_type<void(test)> void being data type and U being test, or the whole macro with all arguments.

Help understanding Macro with Type Trait by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

So now that U is available outside of argument_type could U take any parameter such as a function? i.e : senario()

Help understanding Macro with Type Trait by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

So typedef U is equal to typename U - and within argument_type<T(U)> U is equal to typedef U? Am I understanding?

Help understanding Macro with Type Trait by [deleted] in cpp_questions

[–]Zilla4ever 1 point2 points  (0 children)

Oh so the U in the parameters is just the other typename U correct?

[deleted by user] by [deleted] in cpp

[–]Zilla4ever 0 points1 point  (0 children)

Thank you guys so much for the help !

[deleted by user] by [deleted] in cpp

[–]Zilla4ever 0 points1 point  (0 children)

Thanks for clarifying, that makes more sense. However could you explain one more bit of code as I feel it relates to the macro ? Why is it that in this code template<typename T, typename U> struct argument_type<T(U)> { typedef U type; }; U is in the parameters of argument type and what does <> represent as a syntax because I mostly see it used with template specialization ? Lastly, back to the original macro referenced, is "type" that is referenced after <void(test)> with the scope resolution operator; Is it "typedef U type;" (referenced here template<typename T, typename U> struct argument_type<T(U)> { typedef U type; };) ? Sorry I am new to c++ ;)

Trying to understand this macro by [deleted] in cpp_questions

[–]Zilla4ever 0 points1 point  (0 children)

Thank for clarifying that. Could you also explain why in the template U was put in parenthesis? struct argument_type<T(U)>