ByteLawd
So the practice is included in the 90 hours i take it. Total cost 90 hours of study.
dimazava
What essential properties of these collections do you need in your functions? What are the requirements for the type?
Generally it's smth like "here're functions which should be written in the way so one can SFINAE them", not practical, but studying stuff. I know how to make specific function for specific type to make SFINAE work, but I thought I can unify the exact processing function. One should just process data in any way, say just to reprint the value I'm passing
Guillermo
So the practice is included in the 90 hours i take it. Total cost 90 hours of study.
Yes, of course. You will spend 15 minutes reading theory. The rest of the time is about practice. Some times you will need to spend more time but most of the time you will be doing exercises to articulate what you have learnt
dimazava
Danya🔥
CXX_STANDARD 17
I'd suggest to move to C++20 because there's a useful feature that significantly enhances the code quality for such stuff - C++20 concepts
Guillermo
So the practice is included in the 90 hours i take it. Total cost 90 hours of study.
If you spend more than 30 minutes reading without practicing, you are doing something wrong
dimazava
I'd suggest to move to C++20 because there's a useful feature that significantly enhances the code quality for such stuff - C++20 concepts
Thanks, I've seen them, but it's the task for next "homework" 😄 I should use exact 17 standard
Guillermo
The important thing is practice, not to study thousands of pages
Danya🔥
Thanks, I've seen them, but it's the task for next "homework" 😄 I should use exact 17 standard
Also, there is something called "detector idiom" It was proposed for C++ standard but never got accepted It'll simplify the code substantially https://en.cppreference.com/w/cpp/experimental/is_detected But be careful, the implementation there may not work with all the compilers
Idris
learncpp.com
Thanks bruh
Anonymous
Also, there is something called "detector idiom" It was proposed for C++ standard but never got accepted It'll simplify the code substantially https://en.cppreference.com/w/cpp/experimental/is_detected But be careful, the implementation there may not work with all the compilers
The implementation given in CppReference should work even on a C++17 compiler provided you implement nonesuch (which is also a TS2 feature). void_t became available in C++17. Otherwise the implementation doesn't use anything that was not already in C++17
Majid
We have a loop that is the same size as a list, which removes the elements of the list until the size of the list becomes zero. Then the question is, when the loop goes from zero to up, and removes zero, the next round i becomes incremented by one. Now, when it reaches the end and the size of the list has become one, why doesn't it give an error when i is incremented to ten?
Danya🔥
Even ChatGPT has difficult time understanding you:
It's difficult to provide a specific answer without seeing the code you're referring to, but I can offer some general insights that may be helpful. In C++, when you use a loop to iterate over a container (such as a list), it's generally not a good idea to modify the container's size within the loop. Doing so can lead to unexpected behavior, such as invalid iterators, segmentation faults, or infinite loops. However, if you're removing elements from a container while iterating over it, you can use a while loop instead of a for loop. Here's an example:
Danya🔥
std::list<int> my_list = {1, 2, 3, 4, 5}; auto it = my_list.begin(); while (it != my_list.end()) { if (*it == 3) { it = my_list.erase(it); } else { ++it; } }
In this example, we're iterating over a list of integers and removing the element with the value 3. We use an iterator it to keep track of our position in the list, and we use the erase() function to remove the element and return an iterator to the next element. If we don't remove an element, we simply increment the iterator. As for your specific question about incrementing i when the list size is zero, it's hard to say without seeing the code. However, if i is an integer index that's used to access the list elements, then incrementing it after removing an element is likely to cause problems. When the list size reaches 1, you may still be able to access the last element using my_list[0], but you should avoid incrementing i past the end of the list.
Anonymous
I remember I tried it on MSVC and it didn't work
Works fine on the oldest Visual Studio compiler in Godbolt with C++11 standard even. https://godbolt.org/z/76GsdsKnT
dimazava
Danya what’s the difference between .begin() and .data() 0.0?
Seems like the data() is the pointer to the entire entity. While begin(), as it comes from its name, returns iterator to the first element.
𝕱𝖗𝖔𝖟𝖊𝖓
Is it possible to create an API using c++ ?
𝕱𝖗𝖔𝖟𝖊𝖓
Is it possible to create an API using c++ ?
Please reply as fast as possible.....
𝕱𝖗𝖔𝖟𝖊𝖓
How to create it?
𝕱𝖗𝖔𝖟𝖊𝖓
Is there any specific library ?
𝕱𝖗𝖔𝖟𝖊𝖓
I am on my work.... Please give a quick reply
𝕱𝖗𝖔𝖟𝖊𝖓
Help me out
Pavel
Is there any specific library ?
What kind of API you want to create?
𝕱𝖗𝖔𝖟𝖊𝖓
𝕱𝖗𝖔𝖟𝖊𝖓
Is that mentioned in pinned messages ?
Pavel
Payment API ?
So these things are usually complex, there may be a library that does something similar to what you need, but it's not likely. More likely that you would need to use multiple libraries and write business logic and all the glue code yourself. Assuming you are not proficient un C++ (if you ask such questions) it may take several months at least. So I'm not sure why you are in a hurry.
𝕱𝖗𝖔𝖟𝖊𝖓
It's a humble request from me .... Please help me here... I don't have much time for going through all of that...
Pavel
Is it possible to create an API using c++ ?
And this question, it is possible to create nearly anything in C++, the question is, "does it make sense in your specific situation", and the situations can be very different
mj12
Actually c++ is new to me but I know but about this question
Based on your previous messages, i'd advice you to just use some commercial payment processing service, definitely the fastest way to accomplish your goals.
Pavel
I am not like pro but I am at that level... Where I can solve it out... By the way.. Thank you for your suggestions and giving me way .. ..
I would start with determining what kind of API you need, because this term may mean many things and you need to use different approaches. As I assume you want something like REST or SOAP API for communicating over web? Then you'd need to google libraries that support that specifically. If you're not bound to C++, then I would investigate other options as C++ may not be the fastest/easiest tool to work with web (there are Rust and Go that have more things for web).
Marcelo
Hi all I would like to know if someone can help me to teach C# at least 10 hours or more, I work with PLC but would like to learn C#, then I will pay for the classes , send me a message if is possible Thanks
𝔖𝔞𝔯𝔬
Is there any specific library ?
For this questions chat gpt is the best you can ask
𝔖𝔞𝔯𝔬
Be aware that with c++ you can do anything (and with others leanguages to) but some languages are just a better option when talking about api
𝔖𝔞𝔯𝔬
If u don’t have that much time, use another leanguage (python, js but I personally hate it, or even C#) If u have to do it in C++ for some unknown reason use chat gpt to write some base tamplates or scripts that u will modify and extend
MaaKa
Hey 👋 and greetings everyone I have this doubts as I’m just getting into C++ Creating a console app Should I create a function ‘game’ within a class ? And how to go about that .
Anonymous
好吧
Danya🔥
好吧
Use English
Danya🔥
Hey 👋 and greetings everyone I have this doubts as I’m just getting into C++ Creating a console app Should I create a function ‘game’ within a class ? And how to go about that .
No one can read your thoughts and no one knows what the function "game" is If you want an actual answer, please ask the question properly
MaaKa
I’m trying to create a dice rolling game In c++ but want an option where users of different types can choose different games , So I created a class for players My issue is Should I add a function within the player class for the different games I want to create ? Or create a separate class named ‘game’ and create functions inside for different games And the big twist is How 🥹
Pavel
I’m trying to create a dice rolling game In c++ but want an option where users of different types can choose different games , So I created a class for players My issue is Should I add a function within the player class for the different games I want to create ? Or create a separate class named ‘game’ and create functions inside for different games And the big twist is How 🥹
There are multiple approaches to that, one popular approach is define Game as "pure virtual class" or "interface", a class that has only pure virtual functions. Then hide everything that is different between different types of games behind these functions in the concrete implementations of Game (children of Game). It can be just a function like "process player move" that gets what player has inputted and processes the output, or can be more specific functions for different cases like getAmountOfDiceToRoll(). How you store the data also can be different, you can store the data in the specific classes-implementions or in separate classes/structs. You may also decide to make the base class not pure virtual and store some generic data and methods in it. There are pros and cons in it. Or you can move all the common code into a separate set of files (either making classes or just helper functions there).
dimazava
Hello! Is it possible to constraint tuple containing types while calling a function? e.g: print(std::make_tuple(1, 2, 3)); // Success, all types are the same print(std::make_tuple(apple, 'B', 65536)); // Fail, types are different I see the tuple definition in the way of: template< class... Types > Soooo looks like it's "generalized" by design, but may there be the way to specialize template or smth?
Lakshya
C++
Alexandr
Hi! I have class with next constructor: template<typename T> SomeClass(T&& someObj) { } The main purpose to place someObj to member of SomeClass object. Is it a good idea that this constructor also plays role of copy and move constructors? I separate them by constexpr checking type. Seems ugly..
Alexandr
oh, hurried up... i just forgot about SFINAE power) ignore it
Anonymous
Hi! I have class with next constructor: template<typename T> SomeClass(T&& someObj) { } The main purpose to place someObj to member of SomeClass object. Is it a good idea that this constructor also plays role of copy and move constructors? I separate them by constexpr checking type. Seems ugly..
It is not a good idea and Scott Meyers devotes a whole chapter to it in his book Effective Modern C++. A constructor accepting a universal reference is a bad idea unless it is constrained to accept only a few types.
Alexandr
should have read it
moyo
Hi, does any one have experience using boost-test. I'm using a windows system, and have built the boost library with g++. How can I link it with my vscode project.
moyo
What are the necessary configuration needed.
Ehsan
its kinda of overwhelming so you better just use the terminal
Ehsan
There is no projects in vs code It's not a build system nor an IDE
You can configure a build system if you made configuration inside .vscode directory
Ehsan
You worship jetbrains eh
Skarn
There is no projects in vs code It's not a build system nor an IDE
It is an ide though. You can run cmake projects in it easily
Danya🔥
It is an ide though. You can run cmake projects in it easily
It's not an ide It's text editor with plugins
Dima
nano with plugins
Skarn
CLion
Which is a text editor with a gui wrapper over things like cmake, clangd, etc. If a text editor supports LSP protocol, cmake etc, it is basically an IDE.
Skarn
At least you can build your own one on top of it in a matter of minutes
Danya🔥
Let's not offtop
Danya🔥
If you think it's an ide, than ok