Allows you to write binary components in C++11 that can be used across different compilers and standard libraries
cppcomponents
- The C++11 Components Frameworkcppcomponents
is a header-only, portable library that allows you to create binary C++ components that can be easily used
across different compilers and different standard library implementations.
Here is another way to think of it. You have probably heard of C++/CX the C++
Component Extensions from Microsoft. This library allows you to do much of the same thing, but without language extensions,
and works on multiple compilers on Windows and Linux.
Have you ever wanted to change or upgrade compilers or standard libraries, but were hesitant because your old libraries would have to be rebuilt?
Have you wanted to use 2 compilers together(for example you want to use g++ for some code because of improved C11 features,
and use Visual C for some other code because of easier access to Windows features) but integrating them was too difficult?
Have you wanted to use different standard libraries? For example, on Linux write some code in g++ with libstdc++ and other code in clang++ with libc++?
cppcomponents
allows you to make components, compile them, and use the resulting binaries from other compilers.
The library would probably work on OSX with minimal effort, but I don’t have a Mac.
std::string
, std::vector
, std::pair
, std::tuple
, cppcomponents::function
as function parameters and return valuesThere is no need to link to a component made with cppcomponents
. You just include the header file in your code, and copy the .dll or .so file to same directory as your
executable. It does not matter what compiler or standard library was used to create the .dll or .so file, it just works.
Components written using cppcomponents
have built in support for IUnknown
that makes them COM compatible (and XPCOM compatible).
However, there is no support for other specific COM interfaces and types such as IDispatch, VARIANT,IClassFactory. There are plans for a library to provide this.
cppcomponents/cppcomponents.hpp
-std=c++11
and -ldl
cppcomponents/cppcomponents.hpp
-std=c++11
Unit tests are provided using the Google Test Framework.
To run the test…
testing/test
test.sh
has execute permissions./test.sh
and on Windows test.bat
Copyright John R. Bandela 2013.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)