Rose
/start
Contact me in PM for help!
Anonymous
Good morning everyone
Leovan
Function overloading should be the way to go.
But function arguments are same for both templates
Vincent
But function arguments are same for both templates
This is a valid point 🤔. Since function partial specialization is not allowed, so you may turn to class partial specialization instead.
Leovan
This is a valid point 🤔. Since function partial specialization is not allowed, so you may turn to class partial specialization instead.
Yeah, I found that we can wrap function into class (like in std::tuple for example). But it's not suitable for my case, because Func() is method which initialize class members. So class-wrapper should has reference to it and be friend :( And also it looks a little scary :d
Leovan
Chat Boss
Leovan
The if constexpr method is actually neat.
Yeah, the only thing that scares me is that I have to use C++17
D
Partial specialization is possible for structs. Inside them you can declare static methods
Leovan
Davide
Hi guys! I need to compile my code using an older version of Intel oneAPI, in order to use ICC instead of ICX. Do you know where can i download it? (Ubuntu 22.04)
Thomas
I need an advanced C++ guide for free which can help me with software development, any recommendations? Willing to spend a small amount of money if needed
Pavel
I need an advanced C++ guide for free which can help me with software development, any recommendations? Willing to spend a small amount of money if needed
Try these books: - The Pragmatic Programmer - Effective C++ - More Effective C++ - Modern Effective C++
Sing-ehbe
Thank you it is what i want to say no so much english sorry
Chat Boss
ㅤSimple Sorcerer sent a code, it has been re-uploaded as a file
Simple Sorcerer
ㅤSimple Sorcerer sent a code, it has been re-uploaded as a file
I mean, why are there such chips with #define? Or does it just look cool?
A. R.
I mean, why are there such chips with #define? Or does it just look cool?
This is a GCC expression statement, used for compound statements. The STMT_BEGIN and STMT_END macros are commonly used in C to wrap multi-statement macros, they serve to encapsulate multiple statements within a single block, ensuring that the macro behaves like a single statement when used in the context of control flow constructs like if, while, or for loops By using STMT_BEGIN and STMT_END, it's easier to ensure that the macro expands into a single statement, which can help prevent unintended behavior (assuming the code even compiles; it won't if you use -pedantic iirc) and also improves code readability. It has also been a consistent convention for defining and using multi-statement macros across different codebases, I've seen it in at least few large codebases iirc
A. R.
I think you can see for yourself many different codebases in which this type of macro wrapping has been used if you Google it, you can also see different purposes it potentially serves in a particular scenario, but it all ultimately boils down to compound macro encapsulation.
Richard Luo 🐱
is there any way I can allow pass const lvalue but not rvalue?
Vincent
is there any way I can allow pass const lvalue but not rvalue?
Use =delete or =delete(string-literal) (C++26)
Vincent
https://en.cppreference.com/w/cpp/language/function#Function_definition
\Device\NUL
Is there WaitForMultipleObjects for waiting threads on Linux?
\Device\NUL
semaphore?
So there is no equivalent API?
Learning
So there is no equivalent API?
I don't think so.
H
Hi i want change xmrig source code in network connection i clone project and run in VS I need help to understand the code
H
githubcom/xmrig/xmrig/blob/master/src/base/net/stratum/Client.cpp
\Device\NUL
I don't think so.
There's futex_waitv but seems hard to use
Learning
There's futex_waitv but seems hard to use
dont know that api, you may figure it out.
Aditya
Guys,I have a question Which is the best way to understand vectors??
Aditya
What??
Rose
Purge complete.
🏳️‍🌈GNU/Линуксяша-libre🏳️‍🌈
Thank
Dima
\Device\NUL
Yes
Just practice using it like and ordinary array
A. R.
Yes
What do you exactly want to know about them? You said how to "understand" them; do you mean their standard implementation or the data structure itself? As you might know, the very simplified explanation of a vector is that it's a kind of dynamic array, this video explains the differences between a bare bones dynamic array and vector and a static array well (and containers in C++ in general). Here's a link to this and this on SO & SE about vectors in C++ & the STL implementation with a couple example reimplementation snippets, the "official" docs on std::vector on cppreference.com, a link to another pretty good video explaining the concepts through code. Also check this and this page, they've got some pretty intuitive visualizations over the concepts of std::vector as well. ----- I don't wanna be that guy, but a simple Google search would've gotten you what you needed.
Aditya
This is what I needed for my raycaster thanks for the video!
Rose
Purge complete.
Rose
Purge complete.
Elnee
Hi all. I'm interested what do you think about clang-tidy modernize-pass-by-value. Personally, I hate it, because I got used for reference semantics. Some my colleges used it a lot, I don't know how to negotiate that question. I would like to hear anyone thoughts about this. Thanks. https://clang.llvm.org/extra/clang-tidy/checks/modernize/pass-by-value.html
Ludovic 'Archivist'
Hi all. I'm interested what do you think about clang-tidy modernize-pass-by-value. Personally, I hate it, because I got used for reference semantics. Some my colleges used it a lot, I don't know how to negotiate that question. I would like to hear anyone thoughts about this. Thanks. https://clang.llvm.org/extra/clang-tidy/checks/modernize/pass-by-value.html
You need to consider why we pass things by value in modern C++. The idea is to discard things as soon as possible and to exploit move semantics for that. It has generally more affordances than pass by const reference, and certain types like string_views should probably always be passed by value, whether to copy it when needed or just move up the stack. Pass by const reference is still useful when we want to specifically avoid copying, it doesn't allow faster destruction and doesn't work for all use cases, but it is still useful. We just try to avoid it when the passed item should be semantically consumed
Rose
Another one bites the dust...! Banned ÝÜĻÎÅ. Reason: invite your friends and get banned
Joe
Good morning guys Please can someone help me with documents like pdfs I can use for learning C/C++
Danya🔥
No
Rose
Good morning guys Please can someone help me with documents like pdfs I can use for learning C/C++
Please check out this channel - @Resources for information on learning sources for C and C++ (books and videos) and Frequently Asked Questions.
Кирилл
No
My bad
10001
harmony5 🇺🇳 ⌤
I think the link to the pdfs site may be considered piracy, which is against the rules of the group, so consider removing it.
Joe
Thanks
Ludovic 'Archivist'
Rose
User Кирилл has 1/2 warnings; be careful! Reason: don't link piracy related websites
A. R.
Good morning guys Please can someone help me with documents like pdfs I can use for learning C/C++
Pick up any good book based on any modern standard (preferably a recent one), read all the way through and do the exercises and learn the standard libraries, learn about compilers and your specific target environment (OS & ABIs, runtimes, APIs, etc.) by reading through the docs, go through guidelines and advanced tips + conventions, learn algorithms in case you really want to know advanced level C programming (or even C++)
Ludovic 'Archivist'
I know C#
You may want to spend a bit of time there then: https://www.jacksondunstan.com/articles/5530
A. R.
Learning C/C++ is a never-ending journey, this is just the base of what you need to know to be an actual proper C/C++ programmer If you're merely aiming for competency, you'd need to learn the syntax and keywords of the languages and their standard libraries at the very least, but you wouldn't be able to actually understand and comprehend code
A. R.
There's no such thing as "C/C++"
The forward slash wasn't meant to unify the two. I meant either C or C++, as in both are a pain to get into and master
مرتضی
There's no such thing as "C/C++"
"/" means "or" Just for your knowledge
Ludovic 'Archivist'
The forward slash wasn't meant to unify the two. I meant either C or C++, as in both are a pain to get into and master
C is pretty easy to master, what is not easy is to be strict enough with yourself to be a C programmer
A. R.
"/" means "or" Just for your knowledge
They're right as well, I see where they're coming from honestly. Many novices actually merge the two thinking one is simply the superset/subset of the other.
Ludovic 'Archivist'
That is not something one can really learn
A. R.
C is pretty easy to master, what is not easy is to be strict enough with yourself to be a C programmer
The language itself, sure Learning to implement stuff in it? Not by a long shot
A. R.
Can't get far in C without intimate knowledge of algorithms
Ludovic 'Archivist'
Can't get far in C without intimate knowledge of algorithms
You will not get far anywhere without knowing how a computer works indeed. That is just the same with Python or Haskell
Ludovic 'Archivist'
If you don't know how a computer works, someone like me will likely need to clean after you and bankrupt your company in the process like a grim reaper of shitty implementations
Ludovic 'Archivist'
eXtreme Go Horse can only take you so far