python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Advantages of static_cast over explicit instantiation/construction?
Considering the following function template func declared within MyClass class template:
template < T >
class MyClass {
public:
MyClass() = default;
// ...
template < typename o...
joaocandre
Votes: 0
Answers: 1
Why does this library refrain from using static_cast?
I try to follow the mantra of "no warnings." I try to write my code so that the compiler gives no warnings. I'm starting to use non-standard libraries for the first time.
I recently installe...
user589321
Votes: 0
Answers: 1
Is this a correct way to store different types in the same allocation?
I need to allocate a chunk of memory using malloc and then store multiple values of different plain old data types in there. Is the following a correct way to do it?
#include <cstddef>
#include ...
StableGeneous
Votes: 0
Answers: 1
How to raise error/warning when static_cast-ing values outside the set of enum class
Consider the case where I have to convert an int type to an enum. When doing this with static_cast the risk is that even values out of admissible values of the enum are casted. Take as example the fol...
roschach
Votes: 0
Answers: 0