Artöm
Stephanos
mh
Stephanos
i guess we have different opinions on that :)
Artöm
Yeah, then we say, that it is good to have a lot of little simple functions. We do
int calc() {
int r{ 0 };
// some shit
return r;
}
constexpr int important_var{ calc() }; // duh
Artöm
Thing is, we can't explain constexpr as "just slap it somewhere, it's a good stuff"
Francisco
Artöm
Artöm
To a person who isn't sure how to use if
Artöm
Artöm
It may be harder than virtual functions
Francisco
It's as simple as "constexpr implies compile time execution instead of runtime"
Francisco
If you have constexpr int sum(int lhs, int rhs){ return lhs + rhs; }, what you're telling the compiler is "Hey, do this at compile time if you can"
Francisco
In C++20 we will have inmediate functions, which will be marked as consteval. This forces the function to be executed at compile time
Artöm
Artöm
It may sound easy for one who faced this things a lot
Francisco
Just avoid dynamic allocations and you're good to go
Francisco
They're not used for everything, but if you think your function is quite simple, just mark it as constexpr and the compiler will execute at compile time everytime it can
Artöm
Francisco
It's not that difficult. You just want to know EVERYTHING, which isn't really necessary
Artöm
> mark them as contexpr and wait for the compiler to tell me what's wrong and adapt as I go
That's a way actually. But what we want them to learn is const. And slapping constexpr everywhere explains neither const nor constexpr
Artöm
I admit I may've crossed a line, but I do think every single word in a program should be clear to one who writes it, especially if one learns a language
Francisco
Isn't the keyword constexpr clear enough to you?
Artöm
Like, with C++20 we will be able to do constexpr funcs virtual and have try blocks inside
Artöm
There are similar differences in 11/14
professor
hey guys , is there a way to buggy a directory list crawler in c++?
...
what?
professor
I coded a a function to find all files , directories , and sub directories with its files , but at the moment to change it to D: second hard drive it skips some folders
professor
this is what I am talking about
...
what IDE are you working on?
professor
visual studio 2019
...
include windows headers, put a system("pause"); at the start of main, and run it in the console, then go to vs, press ctrl + alt + p and select your program, now press any key in the console and you got a debugger attached
professor
it works as indeed because if I change the location to D:\username\\Documents it works well
professor
it just skipt some folders
...
step through the code and see why it skips it
...
i doubt its any mistake in the api
Sai Meghana
Liam
Anyone could help at this question would be appreciated:
https://stackoverflow.com/questions/56880708/unexpected-compile-error-in-c-passing-default-value-to-function-parameter
kλletaa
nice name
kλletaa
and nice meme
Mihail
just a normal few
Halp fore it
professor
before coding . learn how to ss or use github to store code , and trace error
just a normal few
Tanks but this exercise is finaliayed for it
Mihail
?
Mihail
also your error is so trivial it's not even funny
just a normal few
Holy Shit
Hi, guys
just a normal few
I have results 3 error
Mihail
like you can't miss it
just a normal few
I have results
just a normal few
Tanks
just a normal few
Halp guys I have an "error" when I put the variable before it's an Ù
Mihail
first show a screenshot/pastebin of your code and explain your problem
Mihail
then we could help you
just a normal few
Ok
just a normal few
Andrea
just a normal few
just a normal few
just a normal few
Sorry for the Italian
Mat
Screenshot or pastebin
Mat
Not this
just a normal few
It's a photo
Mat
And it's useless for us
just a normal few
Why?,
Mihail
i already warned you to not send photos of screens
Andrea
It's a photo
do a screenshot: use a program that capture your screen (or a portion of it), save it as an image, send the image here