This is not possible in C++, it will give you an error about redefining already-defined classes. If you’d like to share behavior, consider inheritance.
Related Contents:
- In what cases do I use malloc and/or new?
- Differences between unique_ptr and shared_ptr [duplicate]
- Constructor initialization-list evaluation order
- Are inline virtual functions really a non-sense?
- Modulo operator with negative values [duplicate]
- How do you reverse a string in place in C or C++?
- How do you exit from a void function in C++?
- Why should I avoid std::enable_if in function signatures
- Finding the type of an object in C++
- What is the closest thing Windows has to fork()?
- How to remove unused C/C++ symbols with GCC and ld?
- Setting an int to Infinity in C++
- Are vectors passed to functions by value or by reference in C++
- Using CMake to generate Visual Studio C++ project files
- How to programmatically cause a core dump in C/C++
- System where 1 byte != 8 bit? [duplicate]
- Where are the man pages for C++? [closed]
- shared_ptr and weak_ptr differences
- How to convert a command-line argument to int?
- Using ‘auto’ type deduction – how to find out what type the compiler deduced?
- How to access the contents of a vector from a pointer to the vector in C++?
- C++ trying to swap values in a vector
- Static variables in C++
- How does C++ STL unordered_map resolve collisions?
- std::set with user defined type, how to ensure no duplicates
- Get the compiler options from a compiled executable?
- How can I use C++ 11 features in Clang?
- How to emplace object with no-argument constructor into std::map?
- Mixing Qt and Boost
- Convert Keras model to C++ [closed]
- What exactly is va_end for? Is it always necessary to call it?
- Using Unicode in C++ source code
- Does this function have explicit return values on all control paths?
- C++ floating point to integer type conversions
- What are some reasons a Release build would run differently than a Debug build [closed]
- Disabling C++ exceptions, how can I make any std:: throw() immediately terminate?
- Could I ever want to access the address zero?
- Why does stringstream >> change value of target on failure?
- Uses of destructor = delete;
- Visual Studio: Run C++ project Post-Build Event even if project is up-to-date
- Move constructor for std::mutex
- Why is there no 2-byte float and does an implementation already exist?
- Error: macro names must be identifiers using #ifdef 0
- Portable UNUSED parameter macro used on function signature for C and C++
- Matlab Coder vs hand coding?
- Why is partial specialization of a nested class template allowed, while complete isn’t?
- What is the difference between QPointer, QSharedPointer and QWeakPointer classes in Qt?
- clang-based cross-platform C++ IDE?
- std::vector (ab)uses automatic storage
- Why is a switch not optimized the same way as chained if else in c/c++?