//! Return the {target => source} map of prescribed substances
std::unordered_map<int, int> Graph::ConsumesSources() const
{
std::unordered_map<int, int> target_sources;
boost::insert(target_sources,
edges_
| boost::adaptors::filtered
(std::function<bool(Edge)>
([](auto const & e){ return e.type_ == Consumes; }))
| boost::adaptors::transformed
(std::function<std::pair<int, int>(Edge const &)>
([](auto const & e) { return std::make_pair(e.to_, e.from_); })
));
return target_sources;
}
std::unordered_map<int, int>
Graph::ConsumesSources() const
{
std::unordered_map<int, int> target_sources;
for (auto const & edge : edges_)
{
if (edge.type_ == Consumes)
target_sources.insert({edge.to_, edge.from_});
}
return target_sources;
}
def ConsumesSources(self): return { edge.to_: edge.from_ for edge in self.edges_ if edge.type_ == Consumes }
I know how complex that looks and to be honest I havenโt used it in real code yet but I think itโs interesting to at least know whatโs in there [...] to get inspiration.
— Jonathan Boccara, Learning C++ Boost: Boost Karma
Thomas works @ClinithinkWales wrestling meaning from medical records ๐. He likes puzzles, running and noodles. ๐งฉ๐๐
$ ls -hs boost_1_69_0.7z 79M boost_1_69_0.7z $ 7z l boost_1_69_0.7z | wc -l 66850
sed s/boost/std/g
sed s/boost//g
bind ~ filesystem ~ function ~ optional ~ range ~ regex ~ smart_ptr ~ thread ~ unordered_map/set ~ thread ~ tuple ~ variant ~ etc ~ etc
noncopyable assign ...
algorithm any archive asio assign bind date_time filesystem foreach format function functional fusion graph interprocess iostreams iterator lambda lexical_cast log mem_fn multi-index optional phoenix pool program_options progress property_map property_tree python range regex serialization spirit string-algorithms thread timer tokenizer tuple unittest unordered_map unordered_set uuid variant
Most libraries are header only.
Filesystem, graph, iostreams, log, python, random, regex, serialisation, timer, unittest require building.
7z x boost_1_69_0.7z && ^ cd boost_1_69_0 && bootstrap.bat && ^ bjam -j8 toolset=msvc-14.1 ^ -s BZIP2_SOURCE=c:/bzip2/bzip2-1.0.6 ^ -s ZLIB_SOURCE=c:/zlib/zlib-1.2.11 ^ --build-type=complete ^ address-model=64 architecture=x86 threading=multi ^ --prefix=d:/boost64 install
Boost.Python enables seamless interoperability between C++ and Python.
The libraryโs use of advanced metaprogramming techniques simplifies its syntax for users, so that wrapping code takes on the look of a kind of declarative interface definition language (IDL).
๐ง๐ค๐
The main issue with Boost.Python—and the reason for creating such a similar project—is Boost
See also: YAS
Boost.Interprocess simplifies the use of common interprocess communication and synchronization mechanisms. Support includes: shared memory, memory-mapped files, semaphores, mutexes ... message queues.