Boostのライブラリは他のBoostのライブラリを利用して実装されていることが多いです。AsioはThreadを利用していますし、MPLはその他の色々なライブラリの実装の助けになっています。そういった関係を抜き出してみました。ただの暇つぶしで特に意味はありません。まあ、生きてるサンプルコードとして使えるかもしれません。
抽出方法
Boostのライブラリはそれぞれディレクトリに分けられているので、ディレクトリ=ライブラリとして、ディレクトリ内のすべてのファイル(.hpp)を走査してincludeしているファイルを元に依存関係を抜き出しました。結構適当です。ソース(.cpp)は見ていません。
ディレクトリ単位で見ているので、Math系のライブラリなど同じディレクトリに実装があるライブラリはひとまとめにされます。
ただし、AnyとかArrayは1ファイルだったので、そういうのは一部特別扱いしています。
一番使われているライブラリ
結果は長いので最後に載せます。
単に参照関係だけ見てもよく分からないので、他のライブラリからよく利用されるライブラリの上位10個までをリストにしてみました。
ライブラリ | 参照されている数 |
---|---|
config | 84 |
type_traits | 61 |
mpl | 57 |
utility | 51 |
static_assert | 43 |
iterator | 37 |
preprocessor | 31 |
ref | 22 |
bind | 17 |
functional | 16 |
一番がConfigなのは言うまでもなく、やはりライブラリのためのライブラリが出てくるというそりゃそうだろ、という結果に。
GraphとMath
Boost.Testを使っているライブラリがあったので見てみたら、GraphとMathはテストコードがソースに入っているみたいですね。これ別のところに移した方がいいんでは……(libs/*/test/ とか)。
結果
利用するもの | されるもの |
---|---|
accumulators | any, array, circular_buffer, concept_check, config, functional, io, iterator, mpl, parameter, preprocessor, range, ref, tuple, type_traits, typeof, utility |
archive | config, integer, io, iterator, mpl, preprocessor, serialization, static_assert, type_traits, utility |
config | utility |
date_time | config, conversion, io, mpl, operators, range, serialization, tokenizer, type_traits |
dynamic_bitset | config, iterator, static_assert |
exception | config, tuple, utility |
filesystem | config, exception, iterator, static_assert, system, type_traits, utility |
flyweight | config, mpl, multi_index, parameter, preprocessor, type_traits, utility |
format | config, optional, utility |
function | config, functional, integer, mem_fn, mpl, preprocessor, ref, type_traits, typeof, utility |
functional | config, integer, preprocessor, ref, static_assert, type_traits, utility |
function_types | config, mpl, preprocessor, type_traits |
asio | array, bind, config, function, iterator, system, thread, type_traits, utility |
fusion | any, array, bind, call_traits, config, function_types, functional, io, lambda, mpl, preprocessor, ref, static_assert, swap, tuple, type_traits, utility |
gil | bind, concept_check, config, iterator, mpl, preprocessor, static_assert, type_traits, utility |
graphlib | any, array, bind, concept, concept_check, config, disjoint_sets, dynamic_bitset, exception, filesystem, foreach, function, functional, integer, iterator, minmax, mpi, mpl, multi_index, operators, optional, parameter, property_map, random, range, ref, serialization, smart_ptr, static_assert, test, tuple, type_traits, typeof, utility, variant, xpressive |
icl | call_traits, concept, concept_check, config, interval, iterator, mpl, rational, static_assert, type_traits, utility |
integer | config |
interprocess | StringAlgo, compressed_pair, config, conversion, integer, intrusive, math, mpl, preprocessor, static_assert, type_traits, utility |
intrusive | config, functional, mpl, static_assert |
io | |
iostreams | array, bind, call_traits, config, function, functional, iterator, mpl, optional, preprocessor, random, range, ref, regex, static_assert, type_traits, utility |
iterator | concept_check, config, lambda, mpl, operators, static_assert, tuple, type_traits, utility |
assign | array, config, mpl, preprocessor, ptr_container, range, static_assert, tuple, type_traits |
lambda | config, mpl, operators, preprocessor, tuple, type_traits, utility |
math | array, concept_check, config, format, function, mpl, random, rational, static_assert, test, tuple, type_traits |
mpi | archive, config, exception, function, graphlib, integer, iterator, mpl, optional, property_map, python, serialization, static_assert, type_traits, utility |
mpl | StringAlgo, bind, config, iterator, lambda, operators, preprocessor, range, ref, static_assert, tuple, type_traits, typeof, utility |
msm | any, bind, circular_buffer, config, function, mpl, parameter, preprocessor, proto, ref, serialization, tuple, type_traits, typeof, utility |
multi_array | array, concept_check, config, functional, iterator, mpl, static_assert, type_traits |
multi_index | archive, bind, call_traits, config, functional, iterator, math, mpl, operators, preprocessor, ref, serialization, static_assert, tuple, type_traits, utility |
optional | config, mpl, type_traits, utility |
parameter | config, lambda, mpl, optional, preprocessor, python, type_traits, utility |
polygon | config, mpl, utility |
bimap | call_traits, concept_check, config, functional, iterator, lambda, mpl, multi_index, operators, preprocessor, property_map, serialization, static_assert, type_traits, utility |
pool | config, static_assert, type_traits |
preprocessor | config |
program_options | any, config, function, iterator, static_assert, type_traits |
property_map | any, bind, concept_check, config, function, graphlib, iterator, mpl, multi_index, optional, serialization, smart_ptr, type_traits |
property_tree | any, config, iterator, mpl, multi_index, optional, serialization, static_assert, type_traits, utility |
proto | config, functional, fusion, mpl, preprocessor, range, ref, type_traits, typeof, utility |
ptr_container | array, circular_buffer, compressed_pair, config, exception, iterator, mpl, range, serialization, static_assert, type_traits, utility |
python | bind, call_traits, compressed_pair, config, foreach, function, iterator, lambda, mpl, operators, preprocessor, ref, static_assert, tuple, type_traits, utility |
random | config, mpl, operators, static_assert, type_traits, utility |
range | array, concept_check, config, iterator, mpl, preprocessor, regex, static_assert, tuple, type_traits, utility |
bind | config, mem_fn, ref |
regex | concept_check, config, functional, iterator, mpl, ref, static_assert, type_traits |
serialization | archive, array, call_traits, config, mpl, operators, optional, preprocessor, static_assert, type_traits, variant |
signals | any, config, function, iterator, mpl, operators, optional, ref, smart_ptr, type_traits, utility |
signals2 | any, bind, config, function, iterator, mpl, optional, parameter, preprocessor, ref, smart_ptr, swap, type_traits, utility, variant |
smart_ptr | config, functional, type_traits |
spirit | StringAlgo, any, array, bind, call_traits, compressed_pair, concept_check, config, foreach, format, function, function_types, fusion, integer, io, iostreams, iterator, lambda, mpl, operators, optional, pool, preprocessor, proto, range, ref, regex, serialization, static_assert, swap, thread, type_traits, typeof, utility, variant |
statechart | bind, config, function, mpl, ref, static_assert, thread, type_traits |
system | config, operators, utility |
test | bind, call_traits, config, exception, foreach, io, iterator, mpl, optional, parameter, static_assert, timer, tokenizer, type_traits, utility |
thread | bind, config, conversion, date_time, function, mpl, optional, ref, static_assert, type_traits, utility |
circular_buffer | call_traits, concept_check, iterator, type_traits |
tr1 | array, bind, config, function, functional, iterator, math, mem_fn, mpl, random, ref, regex, static_assert, tuple, type_traits, utility |
tuple | config, ref, static_assert, type_traits, utility |
typeof | StringAlgo, config, functional, mpl, preprocessor, type_traits, utility |
type_traits | config, lambda, mpl, preprocessor, static_assert, typeof, utility |
units | config, io, lambda, math, mpl, serialization, static_assert, type_traits, utility |
unordered | compressed_pair, config, functional, iterator, mpl, type_traits, utility |
utility | config, mpl, preprocessor, static_assert, swap, type_traits |
uuid | config, io, iterator, random, serialization, static_assert, type_traits |
variant | call_traits, config, lambda, mpl, preprocessor, static_assert, type_traits, utility |
wave | concept_check, config, filesystem, iterator, mpl, multi_index, pool, preprocessor, serialization, static_assert, type_traits |
compatibility | |
xpressive | StringAlgo, any, call_traits, config, exception, fusion, integer, iterator, mpl, optional, preprocessor, proto, range, ref, type_traits, typeof, utility |
interval | config, tribool, utility |
ublas | concept_check, config, exception, functional, iterator, mpl, serialization, static_assert, type_traits, typeof, utility |
conversion | config, mpl, type_traits |
StringAlgo | concept, concept_check, config, function, iterator, mpl, range, regex, type_traits |
tribool | config |
any | config, static_assert, type_traits |
array | config, iterator, swap |
call_traits | config |
compressed_pair | config |
concept | config, mpl, preprocessor |
crc | config, integer |
disjoint_sets | graphlib |
foreach | config, iterator, mpl, range, type_traits, utility |
mem_fn | bind |
operators | config, iterator |
rational | call_traits, config, math, operators, static_assert |
ref | config, mpl, utility |
scope_exit | config, preprocessor, typeof |
static_assert | config |
swap | utility |
concept_check | mpl |
timer | config |
tokenizer | config, iterator, mpl |
minmax | ref, tuple |
単独で動くライブラリはIO State Saversくらいで、ほとんどは他のライブラリに依存しているようですね。
「このライブラリだけ使いたい」という時に、関連ファイルだけ抜き出すのは結構めんどくさそうです。