Dima
so I did that for you
Kumar Vipin
BIGMAC_1
BIGMAC_1
Who can solve this question
klimi
i can
BIGMAC_1
Solve it
mark
homework
mark
take it away
Dima
country roads
Dima
take me home
mark
nice song
klimi
to the place
Kumar Vipin
What a smart bot
are they coded in C ?
Dima
Not so smart
klimi
++
Anonymous
Rose give me a warning...
No exception handling in C 😔
klimi
klimi
Anonymous
How
klimi
klimi
but you have clicked you are fine
Anonymous
Is it for c++ learning
Anonymous
Anonymous
Mountain mama
klimi
Country roads
Anonymous
Take me home
Anonymous
Anonymous
Anonymous
It is just for verification
Anonymous
Then
Anonymous
klimi
Anonymous
So that @MissRose_bot can know that some robot has not entered the group
Anonymous
Okk
Rafi Faseeh
hi guys
klimi
hi
Rafi Faseeh
who help me how to make this?
klimi
u
Anonymous
klimi
this is basicaly just COUT
klimi
just rewrite the text
Rafi Faseeh
klimi
you take a keyboard
Pavel
Is it possible to make a template class (or maybe even a usual class) that can be parametrized with a field (something like offset) to be able to modify this given field for any object of a given class?
Details:
I have a class that have several fields of some type. I'm making an editor application that can modify these fields of the class. I want to encapsulate modifying these fields into Command object, to be able undo-redo changes. But I don't want to make several copy-pasted classes for each field, I want something like template to that I can say which field of this clas it's modifying.
Rafi Faseeh
now we start oop after it say make a project like this but i dont know how to start
nomad
Hei kk
nomad
I did it
Anonymous
hi all
Anonymous
good evning
Rafi Faseeh
must be with class
Pavel
Rafi Faseeh
ok thank u
Raul
For advanced C++ frens: https://pastebin.com/HR8tuKWJ
Raul
I am wondering, how I can populate a vector using variadic templates. I have been able to update the values of multiple classes. However, when I try to get their values, I can at most, only get one. I have pasted code on what I have tried. However, I am not sure what I am doing wrong at this point.
BinaryByter
do a vector<function>
BinaryByter
std::function is generally more versatile and actually has a usable syntax xD
BinaryByter
Raul
Can you give me an example?
BinaryByter
sure
BinaryByter
template<class T, class... var>
void unpacker () {
//do shit with t
unpacker <var...> ();
}
BinaryByter
since variadics are valid with no elements, this code is fine
Raul
I am essentially just trying to do Controller newController(A,B,...Z); <- the ... just means as many classes as I want. Then I can call newController.set(20); and All of the classes will get their values updated to 20. But returning all of their values is the snag that I have hit.
BinaryByter
Raul
Controller is the baseclasss haha.
BinaryByter
make a baseclass for allowed template inputs
Raul
Should I just modify this class?
BinaryByter
but why?
Raul
as in
template<class...Classes>
class Controller
BinaryByter
wait where the fuck do you store your classes inside of Controller?
Raul
I don't
Raul
That's the point, it's supposed to be a controller. I pass the classes into the constructor by reference, it's essentially just a reference to those classes.
BinaryByter
Well... how about you store them? 🤔
BinaryByter
oh wait you store a lambda to their function?
BinaryByter
but why?
BinaryByter
can't you just store the reference?
Raul
I don't want the controller to control the lifetime of the classes.
BinaryByter
std::reference_wrapper<type>