NTNU-IHB / FMI4cpp

FMI 2.0 implementation written in modern C++.
MIT License
96 stars 35 forks source link

Fix bug left from using boost::optional over std::shared_ptr in #9 #11

Closed traversaro closed 6 years ago

traversaro commented 6 years ago

Without this fix, I had problem compiling on Ubuntu 18.04

traversaro commented 6 years ago

By the way, given that you target C++17, have you considered using std::variant for that class?

markaren commented 6 years ago

Thanks for spotting!

By the way, given that you target C++17, have you considered using std::variant for that class?

Not really, I'm not familiar with that type

markaren commented 6 years ago

By the way, given that you target C++17, have you considered using std::variant for that class?

Not really, I'm not familiar with that type

However, std::optional might be an option. But, since the boost dependency is already in place it does not really make much of a difference either way.

traversaro commented 6 years ago

However, std::optional might be an option. But, since the boost dependency is already in place it does not really make much of a difference either way.

It depends, having a build time dependency is quite different from having a dependency on the compiled library. Besides using vcpkg, it is quite common to distribute libraries in windows as installers or even simple .zip archives that contain the headers of the library and the compiled library. If you are able to avoid including boost headers in public headers (for example using the pimpl pattern) and you statically link boost, you can distribute the library binary and headers on their own, otherwise you will always need to distribute the library together with the relevant boost headers.