BinaryByter
to notify the next layer
BinaryByter
I would advise against that
BinaryByter
I'd advise against the overuse of exceptions anyway
many
Oh I won't do that
BinaryByter
as said: the CPU has to do everything it did backwards until it sees a try
BinaryByter
(it does this in order to unallocate everything it allocated)
BinaryByter
(it wont unallocate stuff you allocated with new or malloc)
Erdem Efe Erol
Does anyone in this group now how to activate RoseBot's human verification in a channel like the one in this group?
Dima
Lol! the second one
Dima
you seem to be ignoring the life tips
Mihail
even nano or ME is
You might as well just echo to a file at this point lol
BinaryByter
not really, no
BinaryByter
thos are two different things
Anonymous
Y
Anonymous
Hello their!
Wim
Welcome Micah
Anonymous
So ,what is it about this group?
Anonymous
Hey
S
👋
Anonymous
Dima
So ,what is it about this group?
bunch of indians asking to solve their assignments. that what this group is about.
Dima
welcome
Wim
😂
Anonymous
Doesn't the 7227 people talk?
Mihail
Most don't
Anonymous
Mihail
Mihail
They join ask and then they stay here, but they don't talk
Anonymous
Don't they know life's short...😊
Anonymous
Hi
{zcoder}
I read rules and if I know English well but without much grammar or incorrect it's okay? Or I should leave?
Dima
It’s okay, at least you can tell that
Dima
welcome
{zcoder}
Thanks 😁 I'm happy that I can stay here!
Mihail
I read rules and if I know English well but without much grammar or incorrect it's okay? Or I should leave?
Judging by that message it's probably about 10x better than 99% of the people in the group
Mihail
So yeah
John
Hello
John
I know it's a little off course here but is any one familiar with smart card programming if so private message me I would definitely like to discuss some stuff. I know smart card is mostly java but many c And c++ freelancers in my experience are really good at most other popular languages as well so I thought I'd ask you ladies and gentlemen
Shahadat
I have choice openGL or QT what should I opt for
Ибраги́м
Shahadat
I have recently completed my core c++ what should I opt
olli
I have recently completed my core c++ what should I opt
Do some project and use C++ You can't stop learning new things about C++
Shahadat
Which sort of projects
olli
Whatever you like
olli
or practice wrting code
Shahadat
For example
Shahadat
It means that I should not get into app development right now
Shahadat
I have made some projects like library management, student record mngmnt, hotel management.
Anonymous
How to take input for this question The input format is as follows: 2 //number of test cases 6 //size of my array 1 2 3 4 5 6 // the array elements 6 5 4 3 2 1 5 //test case two input size 1 2 3 4 5 5 4 3 2 1
Martin
Hi, I have been baffled by this problem and can't cume up with a solution. How can one get operator[] to emulate the behaivor of __set_item__ and __get_item__ in Python? i.e. Calling a differennt function depending on the result of operator[] is treated as rvalue or lvalue?
olli
Hi, I have been baffled by this problem and can't cume up with a solution. How can one get operator[] to emulate the behaivor of __set_item__ and __get_item__ in Python? i.e. Calling a differennt function depending on the result of operator[] is treated as rvalue or lvalue?
returning a reference? e.g. the way std::map does it? std::map<std::string, int> m{}; m["123"] = 123; // set std::cout << m["123"]; // get or did i get you requirement wrong?
Martin
Unfortunatelly no. I want to execute different code depending on the case. Example: NDArray a; a[Range(0, 100)] = 1; //copy 1 to element 0~100 auto b = a[Range(0, 100)]; //Create a reference to element 0~100
Martin
But auto b = a[Range(0, 100)]; b = c; //b is now pointing to c instead of copying data from c to a
Martin
So my question is how can I get operator[] to emulate python's __set_key__ and __get_key__ (Python's version of operator[]).
Martin
Or is that impossible?
olli
So my question is how can I get operator[] to emulate python's __set_key__ and __get_key__ (Python's version of operator[]).
if you use references to types you define the assignment operator of. b is now pointing to c instead of copying data from c to a » Custom assignment operator
olli
Or is that impossible?
In the implementation of operator[] you cannot differentiate whether the return type will bet set or not
Martin
I think I got it. Thanks!
Martin
Just to be clear. So the following is impossible in C++? (Assuming NDarray can be constructed from a scalar type) a[Range(0, 100)] = 1;//Sets element 0~100 to 1 auto b = a[Range(0, 100)]; b = 1; //b points to the value 1
Brooks
i'm human .. ^_^
olli
Just to be clear. So the following is impossible in C++? (Assuming NDarray can be constructed from a scalar type) a[Range(0, 100)] = 1;//Sets element 0~100 to 1 auto b = a[Range(0, 100)]; b = 1; //b points to the value 1
I don't get what you mean by the last line, how can you point to a literal but it's quite trivial to get something like this NDArray a(10, 0); // 10 times 0 auto x = a[Range(2, 3)]; x = 2; now a is [0, 0, 2, 2, 2, 0, .... ]
Martin
I'm trying to emulate the syntax of numpy in C++. auto b = a[Range(0, 100)]; b = NDarray(1, 1); //An array of size 1 with all elements initalized to 1
Martin
The problem I'm getting is that since there is no way distinguishing between assigning and getting values. The two two pieses of code should be equlivent in C++. Yet I want them ti have different behaivors.
olli
The problem I'm getting is that since there is no way distinguishing between assigning and getting values. The two two pieses of code should be equlivent in C++. Yet I want them ti have different behaivors.
X operator[] (Range r) { // assume get called return X{ this, r }; } struct X { NDArray *array; Range r; X& operator = (int v) { // "set" was called instead of get // change accordingly return *this; } } How does this not work? ( Think about using smart pointers and stuff instead since lifetime might be hard to track )
Martin
a[...] = c; //Modifes the content of a //But auto b = a[...]; b = c; //Doesn't modify a, instead b points to c
Martin
a,b,c are all the same type (ot at least theres a constructor converting c to NDarray/somthing)
Martin
Reall? I see so way to distinguish the two sets of code. a[...] = c calls opetrator= and auto b = a[...]; b=c calls the same operator=
Martin
you mean overload operator= by r-value or l-value? or operator[]
olli
a[Range(1,3)] = 2; calls operator = (int v) && whereas auto b = a[Range(1,3)]; b = 5; calls operator = (int v) &
Martin
woah.... Thanks a lot!