Ludovic 'Archivist'
I've worked 26 years on c/c++ - no need for the std
Also "no need for the std" guess what, you seem pretty outdated on it
Ludovic 'Archivist'
You say that but it appears you are a complete ignorant of the goal of cv qualifiers
To grab the very word of 1.9: "Access to volatile objects are evaluated strictly according to the rules of the abstract machine."
Ludovic 'Archivist'
To grab the very word of 1.9: "Access to volatile objects are evaluated strictly according to the rules of the abstract machine."
And "When a call to a library I/O function returns or an access to a volatile object is evaluated the side effect is considered complete, even though some external actions implied by the call (such as the I/O itself) or by the volatile access may not have completed."
Bennie
To grab the very word of 1.9: "Access to volatile objects are evaluated strictly according to the rules of the abstract machine."
My original point was do not use something to show off or be cool, you will only trip up yourself. Be clear to any developer why you did it. That way your code and you will last, otherwise you only end up losing your job, your code will be replaced in a heartbeat by maintainable code.
Ludovic 'Archivist'
Ludovic 'Archivist'
I've worked 26 years on c/c++ - no need for the std
Also, appealing to years of practice to demonstrate knowledge is a way of showing you are too lazy to keep on studying your topic. When a doctor does that, they kill or fuck up people's lifes
Bennie
And that was what I was very exactly saying and that was exactly what the code you were picking on was demonstrating, hence the reason I pointed you had not read what you were commenting on
Use const for const, not volatile for const... my point... sorry that I dared to answered something you're an "expert" on.
Ludovic 'Archivist'
Use const for const, not volatile for const... my point... sorry that I dared to answered something you're an "expert" on.
I never used volatile for const, I used a volatile return value, which does nothing, to present the kind of code that is bad, and labeled it as such right around the place you commented, and never meant to use const because const does have an effect there
Ludovic 'Archivist'
Use const for const, not volatile for const... my point... sorry that I dared to answered something you're an "expert" on.
Also, I would advise not putting a label on people at your convenience, be it pro or joe, as well as not behaving like a child when you make a mistake and use it to learn. I get not wanting to read a whole thread of discussion because it takes time, but when someone points out your laziness, taking an uncooperative stance doesn't make things better
Anonymous
Well.. that was.. interesting
Z
The group specializes in programming c??
Anonymous
Anonymous
Yup
I don't think so
Z
I know that a special set of programming language c and c ++
Z
But ask do you know other programming languages?
Anonymous
klimi
Augmented
hi, friends, i need an ISR to call a class member, but i prefer not to use static functions and global instance pointers... i want everything to stay encapsulated within the class... however in arduino framework attachInterrupt can't assign an ISR vector to non-static class members... Is there any genuine c++ workarround?
Anonymous
std::mem_fn may be what you're looking for, not sure if there's a more modern way to do it
Jussi
Yep, std::mem_fn
Augmented
thanks, is it a wrapper for instance::member? I tested few variants with binding, but no luck so far
ajay
Hello world😁😁
Anonymous
Anyone know. Java
shiv
shiv
Got this as a warning
András
Show me your code
Artöm
-std=c++11
Artöm
And maybe include initializer_list
Anonymous
kr4T0X
I'll be back.😊
Dark
/what is the problem with this code of array rotation
Artöm
Rename this
Artöm
All things except first, i and j are unclear
Artöm
K is useless here, reuse j
András
instead of int a, b, c, ... Make this Int a; Ibt b; Int c; ...
Artöm
Problem is, you dont understand what your d is for
Dark
output is okay but its not in order
Artöm
output is okay but its not in order
As it should be. Just add spaces
András
Dark
Artöm
Line 27, add space
Dark
thankyou
Dark
it was a mistake
Dark
😊😊
Dark
how to remove this
Anonymous
how to remove this
It's simple Write code that works
Yaser
Cppcodeprovider for visual studio 2019
András
It's simple Write code that works
But nobody knows what it does😂😂
Ritu Raj
how to remove this
Can you send full code?
Anonymous
Can anyone point out what's the mistake in my code snippet? struct node{ int dist = -1; int m[3][3] = {0}; node(int d){ dist = d; } }; bool comp(node &a, node &b){ return a.dist <= b.dist; } priority_queue<node, vector<node>, comp> q;
Artöm
And not comp, but decltype(comp), since you need to pass a type
Artöm
priority_queue<node, vector<node>, decltype(comp)> q(comp);
Anonymous
priority_queue<node, vector<node>, decltype(comp)> q(comp);
Also, there is another error : error: field 'std::priority_queue<node, std::vector<node>, bool(node&, node&)>::comp' invalidly declared function type _Compare comp;
Anonymous
So, should the comp be declared as bool(node&, node&)>::comp?
Artöm
No
Artöm
Your comp does not satisfy Compare requirement. I assume you use visual studio, right?
Artöm
> For all a, comp(a,a)==false
Artöm
Which compiler?
Artöm
But it doesnt really matter
Artöm
I see it gladly pointed that your comparison function is wrong
Anonymous
It matters
For 2 equal elements, doesn't it just changes the order?