東方算程譚:おかしいぞTR1の正規表現
># type_traitsの小洒落た使いみちおしえてくださいよぉ♪
そいや、仕事をする上で type_traits の有効利用ってどのレベルだろう?
boostの他の実装の移植について殆ど必須なように
本当に良く使われる実装についてはあると便利な道具なんだが
道具を組み合わせて最終的な処理を実装するレベルだと使う必要性がない
例が悪いが [template struct point;]のような奴に
普通に考えたら[T]に[int&]とかを指定する奴はいないのだが
「テンプレートの中でテンプレートを呼んでー」とかがディープになりだして
MPLレベルで組みだすとこの辺りの型を気にしないといけないので必要になる
# 別にpoint<int&>とか指定されても大丈夫なように
# 中で is_reference<>からremove_reference<>しても良いが
# 正直、自分で作るクラスについては「何だかなぁ」感が漂う(認識が甘い?
#
# あ、ちなみにMPLは以前に書いたような奴でふ
最初にtype_traitsに興味を持ったのは[例外を投げないswap]を見て
「うわ、何コレ?魔法ですか?」となりMPLの勉強をはじめたんだが
未だに汎用用途だと実装コストに見合う気配がない
# 小説読みに励んで勉強をサボりすぎてるともいう
# いや、単純においらの想像力がゴミなだけだろうがね
んー、このあたりの解答は2chのboostスレの方々を筆頭に(して良いのか?)
pstadeライブラリのmb2syncさんやそれを平然と使うuskzさんとか、
バリバリと使ってる人だと答えられるんだろうなぁ
フィードバック
# re: type_traitsの小洒落た使い道って何だろう?
2008/01/13 3:19 by
どうしても参照で渡したいけど、T が参照で指定された場合はエラーになるので、remove_reference<> を使うことはあります。
あと仮想テーブル持ってたら上手く動かないようなアルゴリズムとかは is_polymorphic<> で判断したりとか……。
ただ、やっぱり
># 正直、自分で作るクラスについては「何だかなぁ」感が漂う
ことも多々ありますw
# re: type_traitsの小洒落た使い道って何だろう?
2008/01/13 3:52 by
んー、実際問題、is_**とかhas_**、remove_**を
局所的な場面で使うぐらいしかないのかなぁ、やっぱり・・・
>># 正直、自分で作るクラスについては「何だかなぁ」感が漂う
>ことも多々ありますw
んま、**_if系統を使い出すと
本来templateで統一してるってのに
それをわざわざバラしてるわけだからねぇw
# re: type_traitsの小洒落た使い道って何だろう?
2008/01/13 13:06 by
すげぇ汎用的なライブラリをこさえるヒトには便利やけども、
(ライブラリに比べれば)著しく特化された実装には"出番がない"って感じスカ?
# re: type_traitsの小洒落た使い道って何だろう?
2008/01/13 15:03 by
はい、私の認識はそんな感じです
# xRWXJEMdIUX
2014/07/19 0:55 by
RkFjKv Enjoyed every bit of your post.Much thanks again. Much obliged.
# bmIZCCTyuMeyRHJNeC
2014/08/15 16:26 by
Im grateful for the blog.Thanks Again. Really Great.
# oPDIeEwRnMyqOAnEfBx
2014/09/06 19:28 by
Hey there! I've been following your web site for a while now and finally got the bravery to go ahead and give you a shout out from Lubbock Tx! Just wanted to say keep up the fantastic work!
# Excellent blog you've got here.. It's difficult to find quality writing like yours these days. I truly appreciate people like you! Take care!!
2018/09/25 6:12 by
Excellent blog you've got here.. It's difficult
to find quality writing like yours these days. I truly appreciate people like you!
Take care!!
# When I initially commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get several e-mails with the same comment. Is there any way you can remove me from that service? Thanks a lot!
2018/10/01 12:14 by
When I initially commented I clicked the "Notify me when new comments are added" checkbox and now each time
a comment is added I get several e-mails with the same comment.
Is there any way you can remove me from that service?
Thanks a lot!
# Can I simply say what a comfort to find an individual who genuinely knows what they're talking about over the internet. You definitely know how to bring a problem to light and make it important. More people have to look at this and understand this side
2018/10/02 10:44 by
Can I simply say what a comfort to find an individual who genuinely knows what they're talking about over the internet.
You definitely know how to bring a problem to light and make it important.
More people have to look at this and understand this side of your story.
I was surprised you're not more popular given that you definitely
have the gift.
# Awesome things here. I'm very satisfied to look your post. Thanks a lot and I'm looking ahead to contact you. Will you kindly drop me a mail?
2018/11/15 9:31 by
Awesome things here. I'm very satisfied to look your post.
Thanks a lot and I'm looking ahead to contact you.
Will you kindly drop me a mail?