It’s very common in C to write this
void f(T* ptr) {
if (ptr) {
// ptr is not NULL
}
}
You should make a const char*
constructor.
More Related Contents:
- How is a bool represented in memory?
- Converting std::__cxx11::string to std::string
- Does the size of an int depend on the compiler and/or processor?
- Return type of ‘?:’ (ternary conditional operator)
- How much is too much with C++11 auto keyword?
- Objective-C : BOOL vs bool
- Alternative to vector
- Can I assume (bool)true == (int)1 for any C++ compiler?
- What’s the difference between size_t and int in C++?
- “Incomplete type” in class which has a member of the same type of the class itself
- String literal matches bool overload instead of std::string
- using std::is_same, why my function still can’t work for 2 types
- C99 boolean data type?
- C++ : why bool is 8 bits long?
- What are declarations and declarators and how are their types interpreted by the standard?
- bool operator ++ and —
- How to define different types for the same class in C++
- Why is a char and a bool the same size in c++?
- Is there a 128 bit integer in C++?
- Is it ok to read a shared boolean flag without locking it when another thread may set it (at most once)?
- is it ok to specialize std::numeric_limits for user-defined number-like classes?
- How do unsigned integers work
- Converting bool to text in C++
- What is the type of a string literal in C++? [duplicate]
- Do I have to use #include beside ?
- What is a scalar Object in C++?
- What is uint_fast32_t and why should it be used instead of the regular int and uint32_t?
- is it possible to make function that will accept multiple data types for given argument?
- Why does the compiler choose bool over string for implicit typecast of L””?
- Why is a C++ bool var true by default?