Boost総合スレ part7at TECH
Boost総合スレ part7 - 暇つぶし2ch596:デフォルトの名無しさん
09/05/17 00:27:29
俺は今までバイナリでしか使ったこと無い(し、そもそも職場がboost原則禁止orz)から分からないんだが、
例えばBoost.Functionのあるソースを流用して自作ライブラリMy_Libを作り、
My_LibのソースコードをBSDライセンスで公開したい場合はどうすればいいってことになるの?

1.My_Libのソースコードに
  Boost.Functionの著作権表記と
  Boost Software Licenseの全文を記載する。
2.My_Libのソースコードに
 BSDライセンスの全文を記載する。
3.「2.」のBSDライセンスの文言にはBoost.Functionの著作権表記は関わらない。

かい?でもこれだとMy_Libを流用する第三者がMy_LibのBSDライセンスの通りに作ると
Boost.Functionの著作権表記が引き継がれなくなっちゃうよね?

だれか分かるお方、お知恵をお貸しくだされ

597:596
09/05/17 10:03:01
BSDライセンスの著作権表示の場所に
Boost.Functionの著作権表示を一緒に表示させればいいのか。


598:デフォルトの名無しさん
09/05/23 21:43:14
更新しました。
URLリンク(booster.x0.to)
以下更新内容の一部
[Fusion]
Fusion: added explicit disambiguation for fusion::at
[Exeption]
support for exception_ptr and nesting in boost::diagnostic_information
[Dynamic_bitset]
Merge dynamic bitset from release.
[Lambda]
Avoid using namespace std; to prevent ambiguity between boost and std components. Fixes #3025
[Algorithm]
Qualify minmax with boost:: to avoid ambiguity with std::minmax. Fixes #3023
[Filesystem]
Fix Filesystem #2925, copy_file atomiticity
[Serialization]
change number of bits from unsigned int to std::size_t
[Spirit]
Spirit: Added thread safety precaution
[Regex]
Qualify lower_bound with std:: to allow regex to work with Sun CC
[Signals2]
Added ability to create a shared_connection_block which is initially not blocking.
[Graph]
Added new Graphviz parser (recursive descent); does not support subgraphs in edges yet
Fixing bug in labeled graph.
[Mpl]
Fixed a bogus preprocessor directive
[Wave]
Wave: fixed race condition

亦、libs_for_build_boost.rarもICUを4.2d04から4.2に更新しました。

599:デフォルトの名無しさん
09/05/24 11:29:42
exceptionってまだまだ付け足されるね
奥がふかいのかなあ


600:デフォルトの名無しさん
09/05/26 18:16:28
・VisualC++2008EE
・boost1.37.0のuBLAS

URLリンク(www.page.sannet.ne.jp)
の連立方程式をとくサンプルプログラムをコピペして動かしたところ

lu_factorize(A,pm);

で、例外が投げられます。

lu.hppの153行目で引っかかっているようです。
#if BOOST_UBLAS_TYPE_CHECK
swap_rows (pm, cm);
BOOST_UBLAS_CHECK (singular != 0 ||
detail::expression_type_check (prod (triangular_adaptor<matrix_type, unit_lower> (m),
triangular_adaptor<matrix_type, upper> (m)), cm), internal_logic ());
#endif

なぜだかわかりますか?

601:デフォルトの名無しさん
09/05/26 18:34:11
・VisualC++2008EE
・boost1.37.0のuBLAS

で試してみたけど、コンパイル通ったよ。
[]演算子に関してぶーたら言われたから初期化してる場所は書き換えたけど。

602:デフォルトの名無しさん
09/05/26 18:37:20
どう書き換えたのか教えてやれよwwww

603:デフォルトの名無しさん
09/05/26 18:44:13
A[0][0] = 1.0;
とか並んでる場所を全部
A(0,0) = 1.0;
みたいに書き換えただけなんだけど。
ちなみにublas使ったこと無いからこれが正しい書式なのかは知らない。
というか、こっちだとそこ書き換えないとまずコンパイルされなかったよ。

604:デフォルトの名無しさん
09/05/26 19:17:57
>>601-603
ご対応ありがとうございます。
>>603の処置はやっております。
関係ないと思って省いてしまいました。
すみません。

確かに、空のプロジェクトで作り直したところ
今度は正常に動作しました。
問題のある方は、既存のコードに埋め込んだのですが
なぜ、同じコードなのにこちらではNGなのか、まだわかっていません。
一応、FPまわりのコンパイルオプションも確認したのですが、同じでした。。
どうやら、cm(2,2)が双方で違う値を返しているみたいですが、なぞです。

605:デフォルトの名無しさん
09/05/27 04:38:09
悩んだら、とりあえずプリプロセス

606:デフォルトの名無しさん
09/05/28 21:06:02
>>604コンパイルオプションが同じでもFP変える行儀の悪いプログラム
があるとチェックに失敗するらしい。

DirectXのCreateDeviceとかがそうなんだと。ググったら出てきた。

607:デフォルトの名無しさん
09/05/30 18:47:31
更新しました。
URLリンク(booster.x0.to)
以下更新内容の一部
[Spirit]
Spirit: added tokenize_and_parse functions taking multiple attributes
Spirit: added #pragma once to headers in include directory
[Wave]
Wave: Incorporated the changes from latest version of the flex_string class (fixes #2946)
[Graph]
Reduced graph sizes to decrease test run time; fixes #2308
Changed GraphML writer to escape strings; added test of this; fixes #2567
Added graph properties to adjacency_matrix; fixed constructors to match documentation; fixes #875
[Format]
Fix order of initialization warning. Fixes #1699
[Type_traits]
Test for: enum UIntEnum { value = UINT_MAX } is promoted to int
[Lambda]
Avoid ambiguities between boost::lambda::bind and std::bind with VC10. Fixes #3075
[Multi_index]
fixed #3076
[Graph_parallel]
Added "edges_are_sorted" to CSR test case
[Signals2]
Added a little test of a signal taking a reference argument.
Use BOOST_NO_VARIADIC_TEMPLATES instead of BOOST_HAS_VARIADIC_TMPL, etc.
[Proto]
saner default evaluation behavior for member (object|function) pointers
[Math]
Added a couple of static assertions to prevent misuse.
[Thread]
Attempts to improve the boost::thread move semantics; separated tests to give clearer ID; incorporated patch to fix issue #2062
Changed thread_specific_ptr to use a map for faster lookup, and erase empty nodes

608:デフォルトの名無しさん
09/05/31 10:58:06
boost で、実行中のプログラムのパスを取得する手段は提供されていますか?
Win32API で言う所の GetModuleFileName(NULL) ですけど、
OS を問わず使えるようなのがあればな、と。

609:デフォルトの名無しさん
09/05/31 11:12:43
ハードリンクがあるから㍉じゃね

610:デフォルトの名無しさん
09/05/31 12:07:14
int main(int, char *argv[]){
std::cout << argv[0] << std::endl;
return 0;
}

611:デフォルトの名無しさん
09/05/31 13:27:41
>>606
遅くなりすみません。
まさにそれでした!!ありがとうございます。
boostとDirectXでFP精度を合わせるようにして
対応します。

612:デフォルトの名無しさん
09/06/01 10:54:37
そういやboost::spiritって大幅な仕様変更あったの?
spirit使ってるプログラムをビルドすると、

Warning: This header is deprecated. Please use: boost/spirit/include/~

…というwarningがいっぱい出るんだ。
どこかに変更点まとめてるところないかな。

613:デフォルトの名無しさん
09/06/01 12:39:43
>>612
ちょっと前にv1からv2になったよ
v2用のドキュメントがどっかにあったはず

614:518
09/06/01 20:57:05
>>612
#include <boost/spirit/core.hpp>

#include <boost/spirit/include/classic_core.hpp>
みたいに変更になった。
・・・ような記憶がある。
試してごらん。

615:デフォルトの名無しさん
09/06/02 04:44:33
WindowsでJPGファイルを操作(表示と拡大縮小くらい)するプログラムを
書こうと思っているのですが、boost::gilを使うと簡単にかけますか?


616:デフォルトの名無しさん
09/06/02 05:02:35
boost::gilを使っても使わなくても簡単にかける

617:デフォルトの名無しさん
09/06/02 09:33:12
>>613-614
情報㌧
新しくなってたのね。

618:デフォルトの名無しさん
09/06/02 12:43:16
>>615
GDI+を使ったほうがいい

619:デフォルトの名無しさん
09/06/02 20:10:34
Boost.Seriaizationでのshared_ptrのシリアライズでCustom Deleterが
保存/復元されないようなんだが、これってどうにかならないだろうか。

620:デフォルトの名無しさん
09/06/05 23:34:25
更新しました。
URLリンク(booster.x0.to)
以下更新内容の一部
[Detail]
detail/utf8_codecvt_facet.cpp: apply patch from ticket #2986 to quiet warnings when wchar_t is 16-bits.
[Program_options]
Qualify usage of 'exeception', now that boost also has such name
[Signals2]
Fixed bug in test.
Fixing some reference-to-reference problems with some compilers.
Added test for and fixed compile errors in signal::set_combiner()
and combiner() methods. Refs #3125.
[Random]
Fix the distribution of uniform_int.
[Property_map]
Added shared_array_property_map
[Graph]
Changed new-style named parameter code for BGL to use shared_array_property_map, greatly simplifying interface
Re-added the exterior property labeling framework under a different name
[Date_time]
Fixed a possible reading overflow in the var_string_to_int function.
The std::tm instances are zero initialized before usage in to_tm functions. Related to #1859.
[Spirit]
build_tree now has less parameters and limit lines to 80 chars.
Added a param to add() taking a rules object.
Spirit: fixed problem in lexertl library
[Expressive]
prefer mpl::if_c over mpl::if_ for better compile times
[Fusion]
reduce number of template instantiations
[Lambda]
Add result_type to lambda::ret. Fixes #1222

621:デフォルトの名無しさん
09/06/06 02:18:21
spirit v2のドキュメントはもう少し増えないかなー

622:デフォルトの名無しさん
09/06/06 02:48:39
v1からv2にすると何か良いことあるん?

623:デフォルトの名無しさん
09/06/06 03:14:27
着弾速度が音速を超えるので迎撃不可能になる

624:デフォルトの名無しさん
09/06/06 03:34:30
結果、敵の侵攻を早めてしまう可能性もある

625:デフォルトの名無しさん
09/06/06 13:37:11
>623
フォン・ブラウン乙。

626:デフォルトの名無しさん
09/06/06 23:56:41
ptr_vector の逆バージョンのようなコンテナない?

ptr_vector は

ptr_vector<A> v;
v.push_back(new A());
A a = v.front();

こういう使い方ができるけど、

vector_ptr<A> v;
v.push_back(A());
A* a = v.front();

こういう使い方をしたい。
内部構造としては std::vector と同じように連続的に持ってほしい。
無いと思ってコンテナ作成してるんだが、無いよな?

627:デフォルトの名無しさん
09/06/07 00:36:44
無いだろうなぁ。
そういうのがつまりイテレータの仕事だし。
vector<A>::iterator i = v.begin();

628:デフォルトの名無しさん
09/06/07 00:45:46
A* a = &v[0];
だとまずいのか?

629:デフォルトの名無しさん
09/06/07 00:46:29
>>627
ありがと。自作するわ。

BOOST_FOREACH でイテレータ使えるようにならないかな。

BOOST_FOREACH ( std::vector<A>::iterator it, v )
{
  ...
}

こんなかんじで。

630:デフォルトの名無しさん
09/06/07 00:53:31
>>628
std::vector<A*> を使って実装したソースがあって、
あんまりコードを変えたくないんだ。



・・・と思ったがそんなに手間じゃない気もしてきたw

631:デフォルトの名無しさん
09/06/07 00:54:26
>>629
BOOST_FOREACHを参照で受けるとかじゃだめなのか?
イテレータじゃないとだめ?

632:デフォルトの名無しさん
09/06/07 00:55:53
イテレータでいいならrange_exのfor_eachにlambda渡せばいいんじゃね?

633:デフォルトの名無しさん
09/06/07 01:01:05
>>631
なんだかこれで解決できるような気がしてきた。
既存のコード読んでやってみる。

ありがと。

634:デフォルトの名無しさん
09/06/07 01:02:41
>>632
まだ lambda 使ったこと無いんだがそんなこともできるのか!
調べてくる

635:デフォルトの名無しさん
09/06/07 01:04:14
>>634
ごめん、勘違い

636:デフォルトの名無しさん
09/06/07 14:45:37
URLリンク(atnd.org)

URLリンク(124.45.27.25:12086)
IRCNET #CRYBUTSU

637:デフォルトの名無しさん
09/06/07 17:35:00
ぶつぶつ会終わったよー

638:デフォルトの名無しさん
09/06/09 12:38:54
逆行列を求めようと、
URLリンク(www.page.sannet.ne.jp)
をコンパイルしたのですが、
以下のようなエラーが出ます。
test.cpp:33
は上記ページの lu_factorize(A,pm); になります。

/usr/include/boost/numeric/ublas/lu.hpp: In function
‘typename M::size_type boost::numeric::ublas::lu_factorize(M&, PM&)
[with M = main()::dmatrix, PM = boost::numeric::ublas::permutation_matrix<unsigned int, boost::numeric::ublas::unbounded_array<unsigned int, std::allocator<unsigned int> > >]’:

test.cpp:33: instantiated from here
/usr/include/boost/numeric/ublas/lu.hpp:137: error: no matching function for call to
‘project(boost::numeric::ublas::matrix_column<boost::numeric::ublas::matrix<double, boost::numeric::ublas::basic_row_major<unsigned int, int>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> > > >&, boost::numeric::ublas::basic_range<unsigned int, int>)’

何かboostの設定が間違っているのでしょうか?

639:デフォルトの名無しさん
09/06/09 14:31:59
gcc 3.4.6 + BOOST_VERSION 103700
>g++ test.cpp -Wall
>ls
a.out test.cpp
>gcc --ver
gcc (GCC) 3.4.6 以下略
>./a.out
A = [3以下略
問題なし

[別環境]
gcc 4.1.2 + BOOST_VERSION 103301
>scp ほげほげ:./test/test.cpp .
ほげほげ's password:(はげはげ)
>ls
test.cpp
>g++ test.cpp
/usr/include/以下略。同じエラー
>gcc --ver
gcc (GCC) 4.1.2 以下略

[さらに別環境]
VC2008EE + BOOST_VERSION 103700
<memory>で警告食らったけどとりあえずコンパイル成功して動いた

boostのバージョン依存の問題かもしれません。
ひょっとしてもしかしたら、gccのバージョン依存の問題かもしれません。

640:デフォルトの名無しさん
09/06/09 19:55:03
spiritの話題がちらほらでるけど、そんなに使う場面ってある?
簡単なものなら正規表現で十分だから、俺にとっては永遠に出番のなさそうなライブラリーなんだけどなぁー

641:デフォルトの名無しさん
09/06/09 20:13:25
>>640
ちょっと複雑な設定ファイルの文法を簡単に定義できるのが便利。
bison/flexといった外部ツールを使わずにC++ですべて完結するのが良い。

642:デフォルトの名無しさん
09/06/09 20:16:10
spiritの方が大抵速いようだしな。
それでいて柔軟性もあるし

643:デフォルトの名無しさん
09/06/09 20:34:08
spiritとか使ったことがないが、コンパイルにやたらと時間がかかりそうで怖いんだが。

644:デフォルトの名無しさん
09/06/09 20:38:28
コンパイルに時間が掛かるのはその通りだが、今時大した問題でも無いと思う。
まずは使ってみて便利さとコンパイル時間を天秤にかければ良いだろうな。

645:デフォルトの名無しさん
09/06/09 21:33:44
コンパイルするのにメモリもかなり食う
まぁ一度コンパイルしてしまえば(文法規則が変わらない限り)関係ない話だし

646:デフォルトの名無しさん
09/06/09 21:36:27
>>640
>>643

Boost.Spiritは、ぜひとも一度使ってみて、
Boost.Lambdaと同様のあまりの変態さにおののいてみてください。
すげーよまじで。

647:デフォルトの名無しさん
09/06/10 01:21:08
yacc と比較して spirit の構文解析の速度はどうですか?
spirit で何度か C 風文法を解析するプログラムを作ったのですが
パース時に後戻りが多いような気がするのですが。

648:デフォルトの名無しさん
09/06/10 03:36:23
>>647
実際に同じ文法を定義してベンチマーク取ったわけではないけど、spiritは
再帰下降パーサだからバックトラックが遅いんだろうな。
効率が気になる程に長いファイルをパースするなら、やっぱりLALRパーサの
bison(yacc)を使った方が良いと思う。

649:デフォルトの名無しさん
09/06/10 09:00:32
v2の方はコンパイルでアホのようにメモリ喰うな
ちょっとした文法でも1GB普通に超える

650:デフォルトの名無しさん
09/06/12 19:34:55
更新しました。bjamでのビルドに於いて、"--build_all"オプションが削除されました。
URLリンク(booster.x0.to)
以下更新内容の一部
[Graph]
Reverted old version of CSR graph for compatibility, with a #define to switch between the modes; cleaned up interface of new CSR graph; fixed tests and docs accordingly
Changed to shared_array_property_map
Sped up out_degree() and related functions for new interface
[Python]
Allow duplicate enum values. Fixes #2744
[Example]
examples of external main usage
typo
[Regex]
Simplify and fix PP logic.
[Impl,Exeption,Mpl,Detail,Smart_ptr]
avoid C style casts
[Numeric]
Fix a couple of typos in the ublas documentation. Fixes #3056, #3057.
[Variant]
Support BOOST_NO_TYPEID and BOOST_NO_IOSTREAM in Boost.Variant. Fixes #3051.
[Spirit]
Spirit: added placeholders for lexer semantic actions
Spirit: Lot of work done in Lexer, fixed bugs, added support functions, refactored code
[Proto]
virtual_members get proto_arity_c
[Serialization]
Update include from boost/pfto.hpp to boost/serialization/pfto.hpp. Refs #3062.
[Signals2]
Added a copy of Thorsten Ottosen's auto_buffer into signals2/detail
and used it to replace stack_allocator/stack_vector (which worked
on popular compilers but were not strictly standards conforming).

651:デフォルトの名無しさん
09/06/12 20:02:43
foreach ( int a, boost::assign::list_of ( 1 ) ( 2 ) ( 3 ) )
{
  ...
}

でコンパイルエラーが出るんだが、こういうのは無理?

e:\boost\boost\assign\list_of.hpp(163) : error C2661: 'boost::foreach_detail_::rvalue_probe<T>::rvalue_probe' : 2 個の引数を伴うオーバーロードされた関数はありません。

652:デフォルトの名無しさん
09/06/12 21:05:22
boost::flyweight<std::string, boost::flyweights::set_factory<std::less<boost::mpl::_2> > > fw1("1");
std::cout << &fw1.get() << "\n";

boost::flyweight<std::string, boost::flyweights::set_factory<std::less<std::string> > > fw2("1");
std::cout << &fw2.get() << "\n"


以下の4つソースは全て同じ結果になることを期待していたのですが、同じ結果になりません。

(1)
boost::flyweight<std::string> fw1("1");
std::cout << &fw1.get() << "\n";

(2)
boost::flyweight<std::string, boost::flyweights::hashed_factory<> > fw2("1");
std::cout << &fw2.get() << "\n";

(3)
boost::flyweight<std::string, boost::flyweights::hashed_factory<boost::hash<boost::mpl::_2>, std::equal_to<boost::mpl::_2> > > fw3("1");
std::cout << &fw3.get() << "\n";

(4)
boost::flyweight<std::string, boost::flyweights::hashed_factory<boost::hash<std::string>, std::equal_to<std::string> > > fw4("1");
std::cout << &fw4.get() << "\n";


(1)と(2)は同じ結果になりますが、(3)と(4)が(1)や(2)と同じ結果にならないのは、どうしてでしょうか?

(1)と(2)に関してここにも書いてるので、当然な結果・・・
URLリンク(www.boost.org)


653:652
09/06/12 21:06:41
余計なソースまで貼ってしまったので、再度投稿します。

以下の4つソースは全て同じ結果になることを期待していたのですが、同じ結果になりません。

(1)
boost::flyweight<std::string> fw1("1");
std::cout << &fw1.get() << "\n";

(2)
boost::flyweight<std::string, boost::flyweights::hashed_factory<> > fw2("1");
std::cout << &fw2.get() << "\n";

(3)
boost::flyweight<std::string, boost::flyweights::hashed_factory<boost::hash<boost::mpl::_2>, std::equal_to<boost::mpl::_2> > > fw3("1");
std::cout << &fw3.get() << "\n";

(4)
boost::flyweight<std::string, boost::flyweights::hashed_factory<boost::hash<std::string>, std::equal_to<std::string> > > fw4("1");
std::cout << &fw4.get() << "\n";


(1)と(2)は同じ結果になりますが、(3)と(4)が(1)や(2)と同じ結果にならないのは、どうしてでしょうか?

(1)と(2)に関してここにも書いてるので、当然な結果・・・
URLリンク(www.boost.org)

654:デフォルトの名無しさん
09/06/14 13:13:18
boost::typeクラステンプレートって何に使うの?

適当な引数として
boost::type<t>* = 0
のように使っているようだが、意図がよく分からん。


655:デフォルトの名無しさん
09/06/14 15:17:09
>>654
C++は関数テンプレートの部分的特殊化ができないが、オーバーロードを使って同じような事ができる。
boost::type<Hoge>とかboost::type<Fuga>とか引数を変えてオーバーロードし、
Function(x, boost::type<Hoge>());みたいな感じで呼び出す。
boost::type<Hoge>はコンパイラの最適化で消えるため、実行時のコスト0で実現できる。

656:654
09/06/14 16:06:02
>>655
ふーむ。。。

template <typename TIPE>
void Function(int x){~};
とでも定義しておいて
Function<TYPE>(x);
と呼び出すんじゃだめなのかい?

657:デフォルトの名無しさん
09/06/14 18:02:25
>>656
>>655 はこういうことだと思う

template<class T>
void f(T, ...)
{
std::cout << "T";
}

template<class T>
void f(T*, boost::type<T>)
{
std::cout << "T*";
}


int main()
{
double d = 0;
int i = 0;
f(d);
f(&i, boost::type<int>());
f(&d, boost::type<double>());

}

658:656
09/06/14 21:10:20
>>657
悩んだ末、何となく意味が分かった気がする。
部分特殊化で
template<class TYPE *>
void f<TYPE *>(TYPE *, ...)
としたくても出来ないから、
普通の型用とポインタ型用の2つを多重定義するオーバーロードで
似たようなことをしている訳か。

二人ともありがとう!

659:655
09/06/14 22:31:03
>>656-658
言いたかったのは、

Modern C++ Design 30ページより
> ・クラス・テンプレートのメンバ関数については完全な特殊化ができるものの、メンバ関数の部分的な特殊化はできません。
> ・ネームスペース・レベルにおける関数(非メンバ関数)の部分的な特殊化はできません。
> ネームスペースレベルにおけるテンプレート関数に対して許されている機能のうち、部分的な特殊化に最も近いものはオーバーロードです。
> つまり実用上は、関数パラメータに対してのみ(戻り値や内部的に使用される型は適用できません)細かい粒度の特殊化能力を与えることができるわけです。例えば:
> template <class T, class U> T Fun(U obj);// 一次テンプレート
> template <class U> void Fun<void, U>(U obj);// 部分的な特殊化(不正)
> template <class T> T Fun(Windows obj);// オーバーロード(正当)

そして
template <class T> void Function(T x, Hoge/*ダミー*/);
ではなく
template <class T> void Function(T x, boost::type<Hoge>/*ダミー*/);
とすることによって実行速度に影響を与えずオーバーロードを解決できる(boost::type<T>のサイズが0のため)。

660:655
09/06/14 22:33:31
オーバーロードというのは
template <class T> void Function(T x, boost::type<Hoge>/*ダミー*/);
template <class T> void Function(T x, boost::type<Fuga>/*ダミー*/);
っていうこと。

661:658
09/06/15 07:05:57
>>659
ふーん、なるほど。
Boostでやたら多用されているのも分かる気がしてきた。

662:デフォルトの名無しさん
09/06/15 21:47:30
素朴な疑問です。

shared_ptrやscoped_ptrには下記のオペレータがあります。
T& operator*() const;
T* operator->() const;
実装から考えれば全くその通りだと思います。

でも生ポインタを抽象化するという役割を考えると、
下記の方が理にかなっているように思えてなりません。
const T& operator*() const;
const T* operator->() const;
T& operator*();
T* operator->();

後者がNGで、前者でなければならない理由とかがあるのでしょうか?

663:デフォルトの名無しさん
09/06/15 21:50:02
T const* と T* const の違いを考えてみればいい。

664:デフォルトの名無しさん
09/06/15 22:15:29
>>663
なるほど!
確かにポインタ自身のconstを考えると納得です。
すっきりしました。
ありがとうございました。

665:デフォルトの名無しさん
09/06/16 15:07:43
継続はいつ実装されるんだ

666:デフォルトの名無しさん
09/06/20 22:21:29
更新しました。
URLリンク(booster.x0.to)
以下更新内容の一部
[Graph]
Changed function types to enums and removed include of iostream; refs #3134
Added constructors from multi-pass unsorted, filtered edge lists; refs #3134
Added extra named parameters for McGregor maximal common subgraph algorithm; contributed by Michael Hansen; refs #3134
[Functional]
Try to avoid float to int warning when a float function doesn't exist. Refs #3171.
[Spirit]
Spirit: Added operator safe_bool to lexer token type
Spirit: Simplified multi_pass iterator
Spirit: Fixing bogus assertions
Fixup to add() again for Hartmut.
Spirit: Made dummy token constructor explicit
[Random]
Supress warnings from narrowing conversions.
[Fusion]
introduces unfused adapter
fix trac issue #1608
[Proto]
accomodate fusion:vector0 interface change
[Graph_parallel]
Fixed bugs in test case; refs #3134
Fixed warnings; refs #3134
[Python]
Use appropriate default values for global and local dicts.
[Impl]
Fixed support for CRT hooks, it was not working properly with catch_system_errors=no

667:デフォルトの名無しさん
09/06/20 22:38:49
これは乙じゃなくてなんたらかんたら

668:デフォルトの名無しさん
09/06/27 05:07:54
program optionsライブラリって機能の割にはコンパイルしてlib用意しなきゃダメなんだね
OSに依存することやってるわけでもなさそうなのに何故なんだぜ?

669:デフォルトの名無しさん
09/06/27 10:26:24
コンパイラに依存することやってたと思った

670:デフォルトの名無しさん
09/06/27 19:08:43
>>668
テンプレートやインライン関数でないものを含んでいるんじゃないの

671:デフォルトの名無しさん
09/06/27 20:44:52
program_optionsのファイル読み込みはいらないよなぁ
シリアライズの方が手っ取り早いし、ちゃんとやるならspirit使うし

672:デフォルトの名無しさん
09/06/27 21:53:00
program_optionsはBoostに含まれるにしては割と
出来が良くない気がする。
まあライセンスが緩いBoostだから、いっぱいあるのは俺は歓迎だけどさ。

673:progress_display
09/06/27 22:16:05
俺もそう思う

674:program_options
09/06/27 22:36:10
>>673
お前にだけは言われたくない

675:672
09/06/27 22:38:28
>>674
まあまあ。
喧嘩うるなよ。

676: ◆/91kCCQXBo
09/06/28 01:39:40
>>113 ソートのアルゴリズムは習ってないということで。
#include <stdio.h>
#include <stdlib.h>
struct seiseki {
  char name[20];
  int order[6];
} seito[] =
  {{"太郎",80,90,75,70,70}, {"次郎",70,85,80,80,85}, {"三郎",75,95,65,90,95}, {"四郎",65,70,80,75,80},
   {"春子",90,100,85,90,85},{"夏子",100,95,80,85,80}, {"秋子",60,75,90,70,85}, {"冬子",85,80,85,90,95}};
int kamoku;
int cmp(const struct seiseki *a, const struct seiseki *b) {
  int t = a->order[kamoku] - b->order[kamoku];
  return (t==0)?0:(t>0?1:-1);
}
int main() {
  int i, array_size = sizeof(seito)/sizeof(*seito);
  char s_kamoku[6][10] = {"国語","算数","理科","社会","英語","合計"};
  for(i=0; i<array_size; i++) {
    seito[i].order[5] = seito[i].order[0] + seito[i].order[1] +
      seito[i].order[2] + seito[i].order[3] + seito[i].order[4];
    printf("%s,%3d,%3d,%3d,%3d,%3d,%4d\n", seito[i].name, seito[i].order[0], seito[i].order[1],
      seito[i].order[2], seito[i].order[3], seito[i].order[4], seito[i].order[5]);
  }
  for(kamoku=5; kamoku>=0; kamoku--) {
    printf("\n%sの点数で並び替え\n", s_kamoku[kamoku]);
    qsort(seito, array_size, sizeof(*seito), (int (*)(const void*, const void*))cmp );
    for(i=0; i<array_size; i++) {
      printf("%s,%3d,%3d,%3d,%3d,%3d,%4d\n", seito[i].name, seito[i].order[0], seito[i].order[1],
        seito[i].order[2], seito[i].order[3], seito[i].order[4], seito[i].order[5]);
    }
  } return 0;
}

677:デフォルトの名無しさん
09/06/28 01:42:34
宿題スレの誤爆?

678:shared_ptr
09/06/28 08:25:16
includeするだけで使えるってのがウリの一部だというのに・・
本当使えないなモマイラは

679:mpl
09/06/28 11:56:22
>>678
あんなクソでかいライブラリをコンパイルするのなんて待ってられないよなw

680:spirit
09/06/28 15:46:58
同意

681:デフォルトの名無しさん
09/06/28 16:10:57
おまいらおもろいなw

682:noncopyable
09/06/28 17:27:03
>>678 >>679 >>680

おまえら、俺様の前に跪けよな。

683:xpressive
09/06/28 20:32:19
regexはいらない子

684:デフォルトの名無しさん
09/06/28 20:38:01
regexの方がコンパイル速度速いだろ?

685:デフォルトの名無しさん
09/06/28 20:41:15
>>684
俺は
「Boost.Regexは動的正規表現だから、
ユーザーに正規表現文字列を入力してもらって
動的な検索を提供できるのでは」
と思っているのだが。
そんな機会が無くて試したこと無いけど。

Boost.Xpressiveもいる子

686:デフォルトの名無しさん
09/06/28 20:51:01
xpressiveにも動的正規表現処理はあるんだよ。

687:デフォルトの名無しさん
09/06/28 20:54:31
>>686
マジか!
じゃあもうBoost.Regexは…

…いや、なんでもない。

688:デフォルトの名無しさん
09/06/28 21:04:41
残念ながらC++0xに採用されるのはboost::regexなのだよ。

689:parameter
09/06/28 21:17:07
お前らあまりprogram_optionsいじめるなよ

690:boost::tuple
09/06/28 21:28:29
tr1にも入ってるし、僕はいる子ですよね!

691:687
09/06/28 21:29:53
tr1に入るのがBoost.Regexなのは、
歴史的な理由?
つまりある程度枯れているから信頼性があるとか?



最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch