Ludovic 'Archivist'
Never mentioned it
If you mean any other threading implementation than the standard, then you are on your own, deal with your own dragons
MᏫᎻᎯᎷᎷᎬᎠ
You mean you were not asking about threads in the standard?
I mentioned std::jthread not std::thread
MᏫᎻᎯᎷᎷᎬᎠ
I began to understand why a lot prefer C to C++, especially in system programming; because they don't want to match against with so much uncertainty
MᏫᎻᎯᎷᎷᎬᎠ
"Which overload of 10 candidates functions will be called" "Passed copy, lvalue reference, rvalue..."
Anonymous
I mentioned std::jthread not std::thread
Aah ok. My bad then. But whatever I said still applies wrt std::jthread as it does with std::thread. The compiler doesnt decide an overload based on noexcept. So you can't have two destructors one of which is noexcept. But destructors ideally should be noexcept
MᏫᎻᎯᎷᎷᎬᎠ
that is deterministic though
I can't tell if that is a cool thing or not It kinda appeals my eagerness
Ludovic 'Archivist'
I can't tell if that is a cool thing or not It kinda appeals my eagerness
Good and bad are false idols. Tools are not good or bad, a bad craftperson just uses the wrong tool
MᏫᎻᎯᎷᎷᎬᎠ
I mean C++ feels like You have a big double sworded weapon that make extreme shortcuts or blow up a whole system
MᏫᎻᎯᎷᎷᎬᎠ
It's insane what you can do with it
Ludovic 'Archivist'
I mean C++ feels like You have a big double sworded weapon that make extreme shortcuts or blow up a whole system
yeah, but on the flip side, it allows you to implement another turing complete language in less than 200 lines of well arranged code
Pavel
I'm completely lost in iterator types Why this class doesn't satisfy input iterator trait? If anything I would expect it satisfy input but not oputput one 🤔 https://wandbox.org/permlink/3AKng0q4RpeQQCnj
Pavel
Why do you use () in the is_same_v?
It complained when I didn't 🤷‍♂
Pavel
I've read it, and I don't understand it. Should I like declare typedefs in the class named like in the table?
Pavel
Yes
That worked, thanks! https://wandbox.org/permlink/l9mt7lbwWmb4Kk1O I expected it should deduce type of the iterator by the functions I implement on it, but I guess it's more straighforward
MᏫᎻᎯᎷᎷᎬᎠ
This is blog post that summaries a talk from Bjarne "Delivering Safe C++" He mentioned "module-based controls" Madhu sounds familiar?! https://thenewstack.io/bjarne-stroustrups-plan-for-bringing-safety-to-c/
MᏫᎻᎯᎷᎷᎬᎠ
The author of the proposal finds that interesting https://www.reddit.com/r/cpp/comments/170l785/comment/k3mxcqf/
Adeyemo
Hello Everyone why do I enter infinite loop here: void get_based_on_condition(int condition){ Node *temp = head; cout << "Age less than " << condition << endl; while(temp !=nullptr){ cout << "Wait" << endl; if(temp->value->age < condition){ cout << "Worked" << endl; cout << temp->value->name << endl; temp = temp->next; } } }
Adeyemo
Is head gloval variable?
This is a linkedlist and the method is part of the linkedlist so head is available within this scope
Adeyemo
Whereas if head doesn't exist the while loop will not run
Adeyemo
I've fixed the bug
Adeyemo
The issue was the first age was greater than 25 so it never entered the if check and thus it remained at head node
Punk
Hello guys anyone here who worked on a project to create a c shell i would like to a guide on how you did and how i can approach the project. Thanks in advance
Punk
kindly if you ever worked on the project you can dm
Amirhossein
Hi every body who can help me for my question ?
Rose
Hi every body who can help me for my question ?
Don't ask meta questions. In other words, don't ask to ask. Questions like "Does anyone know XYZ?", "Has anyone used XYZ?" or "Can someone help me?" are all considered meta questions because they don't specify what your actual problem is. These questions give the impression that you want people to approach you and offer their help as if they don't have any other work to do. Now doesn't that expectation make you look like an idiot? If you have a question ask it directly. You are more likely to get a response that way.
Amirhossein
#meta
What is the greatest common multiple?
Rose
What is the greatest common multiple?
User Amirhossein has 1/2 warnings; be careful! Reason: banned in Google — warned in the group
Anonymous
This is blog post that summaries a talk from Bjarne "Delivering Safe C++" He mentioned "module-based controls" Madhu sounds familiar?! https://thenewstack.io/bjarne-stroustrups-plan-for-bringing-safety-to-c/
Haven't seen that video yet. Been a while since I checked up on C++. I think maybe you are referring to epochs. But from the write ups, it seems Bjarne is suggesting something slightly different from epochs (idea however is same)
skill
Friends who can help with an assignment from the university
klimi
Friends who can help with an assignment from the university
Did your teacher say you are allowed to send this to some group and others can work on your solutions?
Software
Generating random numbers in computers has always been an intriguing topic for me. I have often pondered how computers can generate a truly random number and how they can ensure the randomness of that number. However, the truth is that computers cannot generate truly random numbers as they are deterministic machines that follow a set of rules and algorithms. Nonetheless, they can generate pseudo-random numbers that appear to be random but are actually generated through a mathematical formula or algorithm. One common method for generating pseudo-random numbers is the linear congruential generator (LCG) algorithm. This algorithm uses a starting value, called a seed, and a set of mathematical operations to generate a sequence of numbers that appear to be random. The seed value can be chosen randomly or based on a specific input, such as the current time or user input. Another method for generating pseudo-random numbers is the Mersenne Twister algorithm, which is a more advanced and complex algorithm that generates a longer sequence of numbers with better statistical properties. In summary, computers generate pseudo-random numbers through mathematical algorithms that use a starting value or seed to produce a sequence of numbers that appear to be random. While these numbers are not truly random, they are suitable for many applications that require a degree of randomness. Nonetheless, it is important to note that for applications that require a higher level of security, such as cryptography, cryptographically secure random number generators should be used.
Nice
Chat Boss
Asahi Ikeda sent a huge message, it has been re-uploaded as a file Hey, I am making a Board game framework in C++ (Basically you can create your own TicTacToe, or ..
Asahi
Thanks in advance
Ziky
Thanks in advance
I feel you would need to instantiate classes in the heap and they are essentially only ids which will be too wasteful what do you mean by this?
Asahi
Lets say I create an interface for a Tile class. Now I can only interact with the pointer to that tile interface anywhere in the code. This also means if I am creating a "Tile" somewhere in the code I will have to instantiate it on the heap and remember to free memory for it.
Ziky
I would expect board class to keep two dimensional array of tiles since its construction
Asahi
Yeah, but what would the tiles contain? In TicTacToe there are 2 tiles. In Chess there are 6 different Tiles.
AlanCcE
Yeah, but what would the tiles contain? In TicTacToe there are 2 tiles. In Chess there are 6 different Tiles.
I think you could use an Enum to represent the pieces (or tiles as ur saying)
Alessio
Hi people, there is someone that create games here?
Rose
Hi people, there is someone that create games here?
Don't ask meta questions. In other words, don't ask to ask. Questions like "Does anyone know XYZ?", "Has anyone used XYZ?" or "Can someone help me?" are all considered meta questions because they don't specify what your actual problem is. These questions give the impression that you want people to approach you and offer their help as if they don't have any other work to do. Now doesn't that expectation make you look like an idiot? If you have a question ask it directly. You are more likely to get a response that way.
mito
Hello guys anyone here who worked on a project to create a c shell i would like to a guide on how you did and how i can approach the project. Thanks in advance
There are lots of articles about this. For example, the below. https://brennan.io/2015/01/16/write-a-shell-in-c/
Ben
Hi
Ben
Bruh my msg got deleted, what i was saying is, if somebody is interested on working in a project of genetic algorithm in c++ let me know
Cesar
Your message showed half a second and got deleted.
Manav
Thanks in advance
Overgeneralizing like this is often a recipe for disaster. I'd suggest you write the usage code first. The board for several games like tic-tac-toe chess, etc. Then you identify common concepts like the turn based gameplay, piece movements, tilemapping, etc. Then proceed to refactor the common functionality into the framework
Manav
Lets say I create an interface for a Tile class. Now I can only interact with the pointer to that tile interface anywhere in the code. This also means if I am creating a "Tile" somewhere in the code I will have to instantiate it on the heap and remember to free memory for it.
If you don't want to then leave the memory management to the enduser (who will use your framework). Don't take ownership of the objects. but imo you are proceeding to this problem with no direction. As i said earlier make two three board games, see what functionality is common and refactor that to your framework. Don't try to generalize for everything.
Pavel
Lets say I create an interface for a Tile class. Now I can only interact with the pointer to that tile interface anywhere in the code. This also means if I am creating a "Tile" somewhere in the code I will have to instantiate it on the heap and remember to free memory for it.
There are multiple ways to store tiles to avoid headache. You can store a dynamic array (std::vector) of tiles, then, even though they are allocated on heap, the memory management will be handled by the vector and they will be freed with your class. If you need tiles themselves be stored through a pointer to the parent class, you can use std::unique_ptr to manage their lifetime. Generally if you avoid raw new/delete and malloc/free and use the safe ways to manage memory it is much less likely to mess up with the dynamic memory
Pavel
Asahi Ikeda sent a huge message, it has been re-uploaded as a file Hey, I am making a Board game framework in C++ (Basically you can create your own TicTacToe, or ..
Answering your initial question, you can make template parameters that are values, and make, for example, an std::array that gets its size as that value. However using templates in the first place for this task feels like an overkill
Ꭺlaa
Can i ask for Arduino here ?
Sasha
Can i ask for Arduino here ?
https://dontasktoask.com
Erick
Is a topics good idea?
Aryan
/start@MissRose_bot
Rose
/start@MissRose_bot
Heya :) PM me if you have any questions on how to use me!
Samarth
I am working with serial ports and I need to parse a buffer from it which contains various combination of bits in it set to 1 and 0. Depending upon those bits I need to trigger an event. What approach should I take to achieve the same?
Mansi
/start@MissRose_bot
Rose
/start@MissRose_bot
Heya :) PM me if you have any questions on how to use me!
Rose
Heya :) PM me if you have any questions on how to use me!
Anonymous
hello
Rose
Reported Clay Townsend [6365495301] to admins.​​​​​​​​​​​​
.
Hello how can I make my own Betty style checker ?
Ziky
Hello how can I make my own Betty style checker ?
I never met any Betty in my life so I have no idea how hers style might look like but anyway. I would open the file (for reading), check Bettys requirements and print errors and then close the file.
Kid
i need help
klimi
i need help
you should have read the rules first tho