chaincodelabs / libmultiprocess

C++ library and code generator making it easy to call functions and reference objects in different processes
MIT License
29 stars 20 forks source link

Reduce boost usage #16

Closed vasild closed 4 years ago

vasild commented 4 years ago

A few changes that remove the usage of boost from some places in the code.

vasild commented 4 years ago

The remaining boost usages would need bigger changes. Is fully removing boost to be attempted? The README contains "The boost dependency should be eliminated".

ryanofsky commented 4 years ago

I'm seeing a compiler error due to a (pre-existing) missing include exposed by this change:

[ 85%] Building CXX object CMakeFiles/mpgen.dir/src/mp/gen.cpp.o
libmultiprocess/src/mp/gen.cpp: In function ‘void Generate(kj::StringPtr, kj::StringPtr, kj::StringPtr, kj::ArrayPtr<const kj::StringPtr>)’:
libmultiprocess/src/mp/gen.cpp:148:77: warning: ‘capnp::ParsedSchema capnp::SchemaParser::parseDiskFile(kj::StringPtr, kj::StringPtr, kj::ArrayPtr<const kj::StringPtr>) const’ is deprecated [-Wdeprecated-declarations]
     auto file_schema = parser.parseDiskFile(src_file, src_file, import_paths);
                                                                             ^
In file included from libmultiprocess/src/mp/gen.cpp:8:0:
include/capnp/schema-parser.h:103:16: note: declared here
   ParsedSchema parseDiskFile(kj::StringPtr displayName, kj::StringPtr diskPath,
                ^~~~~~~~~~~~~
libmultiprocess/src/mp/gen.cpp:169:10: error: ‘transform’ is not a member of ‘std’
     std::transform(guard.begin(), guard.end(), guard.begin(), [](unsigned char c) {
          ^~~~~~~~~

Adding #include <algorithm> to src/mp/gen.cpp fixes it. I'll try to edit the PR and merge it today if github will allow editing. If not, I'll just wait a day and merge this tomorrow, following up with the fix separately if still needed.

ryanofsky commented 4 years ago

I was able to add the <algorithm> include and merge as abb3ae9ce9a0837e60013a1c413888859983b3d4. Thanks again!

vasild commented 4 years ago

Thanks! I was just about to fix it, but you were quicker :) I did not get that compilation error (clang 8.0.1), but I guess that is not so interesting now.

Next thing, time permitting, I will look to nuke the other boost usages.