Use the inline
keyword.
inline std::ostream& operator<< (std::ostream& o, const error_code& e) {
return o << "[" << e.hi << "," << e.lo << "]";
}
More Related Contents:
- How do I compare chars (or strings) using void functions, also comparing chars that were taken from a struct array
- Function Recurssion: [duplicate]
- What are all the common undefined behaviours that a C++ programmer should know about? [closed]
- How to determine if a string is a number with C++?
- Base64 decode snippet in C++
- Create Random Number Sequence with No Repeats
- Why can’t variable names start with numbers?
- Selectively disable GCC warnings for only part of a translation unit
- printf with std::string?
- Why don’t compilers merge redundant std::atomic writes?
- Printing 1 to 1000 without loop or conditionals
- C++ implicit copy constructor for a class that contains other objects
- How do I check if a C++ std::string starts with a certain string, and convert a substring to an int?
- lifetime of a std::initializer_list return value
- May I take the address of the one-past-the-end element of an array? [duplicate]
- Loading 8 chars from memory into an __m256 variable as packed single precision floats
- Brace-enclosed initializer list constructor
- error LNK2005: already defined – C++
- Why must SetWindowsHookEx be used with a windows message queue
- Where can I use alignas() in C++11?
- c++ lambdas how to capture variadic parameter pack from the upper scope
- Why use a const member function?
- g++ variable size array no warning?
- When can you omit the file extension in an #include directive?
- how to implement a class in c [duplicate]
- dynamic_cast from “void *”
- Various questions about RSA encryption
- Why can’t I replace std::map with std::unordered_map
- How to throw std::exceptions with variable messages?
- Right Justifying output stream in C++