Anonymous
I am pleasure to hear the difference you think
klimi
Auto is come with 17?
C++11 c++14 and c++17
Ludovic 'Archivist'
I am pleasure to hear the difference you think
All the changes in constexpr, attributes, if constexpr, variant, optional
Anonymous
oh that are very nice features
Ludovic 'Archivist'
Template metaprogramming has been made very very simple by C++17 and lots of tools for it were added
Anonymous
I ...just no chance to use template ,constexpr etc
Anonymous
can you please explain how to use std::thread in oop way
Anonymous
most tutorial just do procedure samples
Anonymous
like std::thread my_thread{[](){//code here}}
Ludovic 'Archivist'
like std::thread my_thread{[](){//code here}}
That is more functional programming than OOP
klimi
Is that lambda
Anonymous
it is
BinaryByter
so I want oop way
functors I guess
klimi
Hello maxi
BinaryByter
classes with operator() overloaded
Ludovic 'Archivist'
so I want oop way
Give a function or an object with an operator() I guess
klimi
I feel stupid '^^
BinaryByter
but ... go difficult when easy is fine to?
BinaryByter
Ludovic 'Archivist'
Is that lambda
BTW, yes, it is
klimi
BinaryByter
Okay
this is expert knowledge
klimi
this is expert knowledge
I need to be expert
BinaryByter
you don't
klimi
But he said they use more c
klimi
Like... Only c
Anonymous
By using other multithread library ,when I need a thread I just inherit the base thread class ,but I modern cpp ,I just need to create a obj ,so strange
Ludovic 'Archivist'
like std::thread my_thread{[](){//code here}}
Keep in mind threads are like primed grenades, you would not want to shake them too much
BinaryByter
like I did
Anonymous
Anonymous
Please
Anonymous
I am having problem in codechef feb challenge question
Anonymous
😍ི
Anonymous
Solve this one
BinaryByter
can you show me your code
yea I can give you the code of a threadscheduler I wrote
BinaryByter
https://github.com/Wittmaxi/ZENeural/blob/master/library/header/internals/util/ThreadScheduler.hpp
BinaryByter
here
Anonymous
Do you know how creating a thread work internally?
Internally? thread code in run function in Java
klimi
BinaryByter
Ludovic 'Archivist'
Internally? thread code in run function in Java
As in what are the steps for creating a thread and have it scheduled by the OS
Anonymous
When we need to use template
Anonymous
That's why I use std::thread provided by cpp
Anonymous
Hey I have an header file cs50.h in my c program and cs50.h present in lcs50 library so everytime i have to compile my file with gcc i have to link it with gcc $ gcc file.c -lcs50 So my question is that can i configure gcc to automatically link lcs50
klimi
Make a makefile
BinaryByter
klimi
If you want simple workaround
klimi
You can make alias
klimi
But it's very dirty solution
BinaryByter
So i dont have to type -lcs50 everytime
If you configured gcc to automatically link against it, it would link it again any other of your programs leading to many many compatibility and program size issues
klimi
You can do something like
Anonymous
Ok so i have to use makefile right
Ludovic 'Archivist'
That's why I use std::thread provided by cpp
You can know how it works and still use std::thread
klimi
Alias lazy="gcc -lcs50 "
BinaryByter
you should, infact
BinaryByter
Thanks :D
BinaryByter
yep!!
BinaryByter
@shell_0 are you proud of me?
BinaryByter
I used a pointer because it was nessecary to
Anonymous
I'm very proud of you!
BinaryByter
thank you!
BinaryByter
BinaryByter
:D
Anonymous
why u use std::function here
BinaryByter
Its the simplest wrapper around functions
BinaryByter
of any kind