ã¾ã¨ã
æ¦è¦ ã¡ãã£ã¨ãããã¹ããæ¸ããããã§ãã¡ããã¨ãããã¹ãã£ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ãå°å ¥ããã®ã¯éãâ¦ãããªæã«boostã®lightweight_testã便å©ã§ãã ããã¯boost/detail/lightweight_test.hppã«ããã¾ããdetailãã£ã¬ã¯ããªä»¥ä¸ãªã®ã§ã¡ãã£ã¨åããã«ãâ¦
以åã®è¨äºã§BOOST_PP_REPEATã«ã¤ãã¦æ¸ãã¾ããã BOOST_PP_REPEATã¯ä¼¼ããããªè¨è¿°ãç¹°ãè¿ãéã«å©ç¨ã§ãã¾ããä¾ãã°ã以ä¸ã®æ§ã§ã(ãã®ã³ã¼ãèªä½ã«æå³ã¯ããã¾ãããâ¦) #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/repeat.hpp> #define VALUE(z, n, d) const int BOOST_PP_CAT(VALUE_, </boost/preprocessor/repeat.hpp></boost/preprocessor/cat.hpp>â¦
boost::anyã¯åçåã¨ãè¨ããã¦ãã¾ããã¾ãã§åçåä»ãè¨èªã®ããã«boost::anyã«ã¯ããããåã®ãªãã¸ã§ã¯ããä»£å ¥ããåãåºããã¨ãã§ãã¾ããboost::anyã«æ ¼ç´ãããã¨ãåºæ¥ãåã®è¦ä»¶ã¯ä»¥ä¸ã®3ã¤ã§ãã ã³ãã¼ã³ã³ã¹ãã©ã¯ãå¯è½ãªã㨠ä¾å¤ã«å¯¾ãã¦â¦
BOOST_PP_REPEATã¯å¼æ°ã«æ¸¡ããããã¯ããæå®åæ°åå±éãããã¯ãã§ãã æ¸å¼ã¯ä»¥ä¸ã®ããã«ãªãã¾ãã BOOST_PP_REPEAT(c, m, d) cã¯ãä½åå¼æ°ã«æ¸¡ããããã¯ããå±éãããã®åæ°ãæå®ãã¾ãã ä¾ãã°5ãå ¥ããã°æå®ããããã¯ãã¯5åå±éããã¾ãã â¦
boost::program_optionsåå空éã«ããã¯ã©ã¹ãç¨ããã¨ãã³ãã³ãã©ã¤ã³å¼æ°ï¼ãªãã·ã§ã³ï¼ãæè»ã«ç°¡åã«è§£æã§ãã¾ããèªä½ã¢ããªã±ã¼ã·ã§ã³ã§ãªãã·ã§ã³ãã¤ããã®ãªãã°ä½¿ããªãæã¯ãªãã§ãã å ·ä½çã«ã¯ã渡ãããã³ãã³ãã©ã¤ã³å¼æ°ãã³ãã³ãæ¯ã«ï¼â¦
C++ã§ã¯é¢æ°å ã«ãã¯ã©ã¹ãå®ç¾©ãããã¨ãã§ãã¾ãããã®ã¯ã©ã¹ã¯ãã¼ã«ã«ã¯ã©ã¹ã¨å¼ã°ããéçã¡ã³ããå®ç¾©ã§ããªãããã¼ã«ã«å¤æ°ã«ã¢ã¯ã»ã¹åºæ¥ãªããé¢æ°ã®å¤ããã¤ã³ã¹ã¿ã³ã¹åãã§ããªãããªã©ã®ç¹å¾´ãããã¾ãã ãã¼ã«ã«ã¯ã©ã¹ã®ä½¿ãã©ããã2ã¤ç´¹ä»â¦
ã·ã¼ã±ã³ã¹ã³ã³ãã(vector, string, deque)ã¨listã¨é£æ³ã³ã³ãã(set, map, 以ä¸ç¥)ãã®3ã¤ã«åãã¦æ´çãã¾ãã "c"ã¯ããã®æã®ã³ã³ããã®ã¤ã³ã¹ã¿ã³ã¹ã表ãã¾ããstd::ãçç¥ãã¦ãã¾ããå®å ¨ãªã³ã¼ãã§ã¯ããã¾ããã ç¹å®ã®å¤ãåé¤ãããæ ã»ã·ã¼ã±â¦
åç¹æ§ã«ãããªã¼ãã¼ãã¼ãã¯ããã¤ãæ¹æ³ãããã¾ãããç®çã«åãããæ¹æ³ãã¨ãã®ãè¯ãã¨æãã¾ããã»ä½éããã®åç¹æ§ã§ãªã¼ãã¼ãã¼ãããããå ´å ã»ããåç¹æ§ãã©ããã§ãªã¼ãã¼ãã¼ããããå ´å ã»ããåç¹æ§ã§ãããªã¼ãã¼ãã¼ããã¦ã»ãããªãâ¦
ã³ã³ã¹ãã©ã¯ã¿ãæ¸ããã¤ãããé¢æ°å®£è¨ã¨ã¿ãªãããæãããã¾ãã ããã¯ä¿ã«ããC++ã§æãå¥å¦ãªè§£æãã¨è¨ããã¦ãã¾ãã 以ä¸ã®æ§ãªæã§ãã struct foo{}; struct hoge { //å¼æ°ã1ã¤åãã³ã³ã¹ãã©ã¯ã¿ hoge(foo f) : f_(f) { } void func(){} foo fâ¦
boost::in_placeã使ãã¨ç¢ºä¿ããã¡ã¢ãªã«ãªãã¸ã§ã¯ããå¾ããæ§ç¯ã§ããããã«ãªãã¾ãã copyä¸å¯ãªãªãã¸ã§ã¯ããåæ§ç¯ã§åä»£å ¥ã®ãããªæ¯ãèããããããã¾ããtrivial destructorããã¤ã¯ã©ã¹ã¯ãã¹ãã©ã¯ãããã«åæ§ç¯ã§ãã¾ãã #include <iostream> #inclu</iostream>â¦
trivial class wikipediaã®å®ç¾©ã«ããã¨ã trivial ãªã¯ã©ã¹ã»æ§é ä½ã¯ã以ä¸ã®ããã«å®ç¾©ãããã ã³ã³ãã¤ã©å®ç¾©ã®ããã©ã«ãã³ã³ã¹ãã©ã¯ã¿ãæã¤ãã³ã³ã¹ãã©ã¯ã¿ã® default æå®ã®è¨æ³ãç¨ãã¦ãã (SomeConstructor() = default;)ã ã³ã³ãã¤ã©å®ç¾©ã®â¦
Visitorãã¿ã¼ã³ã¯ã¯ã©ã¹ãããã¼ã¿ã¯ã©ã¹(Acceptor)ã¨å¦çã¯ã©ã¹(Visitor)ã«åé¢ãããã¼ã¿ã¯ã©ã¹ãå¤æ´ããã«æ°ããæä½ãå®ç¾©ã§ããããã«ãããã¿ã¼ã³ã§ãã ãã¼ã¿ã¯ã©ã¹ãç°ãªãããã¤ãã®è¦ç´ ãæã¡ããããã®åãã¨ã«ç°ãªãæä½ãå¿ è¦ãªæ ãã¼ã¿ã¯â¦
ã³ã³ãããåæåãä»£å ¥ããéãpush_backçã並ã¹ãå¿ è¦ããªããç°¡åã«æ¸ããããã«ãªãã¾ãã ã¤ãã¬ã¼ã¿åæåã«å¯¾å¿ãã¦ããã¯ã©ã¹ãªã使ãã¾ãããµã³ãã« #include <boost/assign.hpp> #include <vector> #include <list> #include <map> #include <string> using namespace std; int main() { using </string></map></list></vector></boost/assign.hpp>â¦
C++ã®ããã®APIãã¶ã¤ã³èªãã§ãã¦åãã¦ç¥ã£ãã®ã§ã¡ã¢ã è¤æ°ã®é¢æ°ãå ¥ããããstd::functionã¿ãããªãã®ã åãã·ã°ããã£ã®é¢æ°ãã¤ã³ã¿ã»é¢æ°ãªãã¸ã§ã¯ããè¤æ°ç»é²ãã¦ãã¾ã¨ãã¦å¼ã³åºããã¨ãã§ããã å¼ã³åºãé åºã¯ããã©ã«ãã ã¨ãç»é²ããé â¦
å¤ä¼ã¿ä¸ãµãã£ã¦ãã¾ã£ã⦠ãã¤ãã¼ã¹ã§è¡ããï¼ï¼ ããèªåã®ããã°ã©ã ã«é¢ããç解ã誤ã£ã¦ããã®æ°ã¥ããæ¹ã¯ã³ã¡ã³ãã§çªã£è¾¼ãã§é ããã¨å¬ããã§ãâ¦ä»åã¯boost::optionalã試ãã¦ã¿ãã boost::optionalã¯ãTåã«ç¡å¹å¤ã追å ããåã¿ãããªãã®ãCâ¦
èªåãboostå ¨ç¶ç¥ããªãã®ã§åå¼·ç®ç ã㤠身å ã¸ã®å®£ä¼ãå ¼ãã¦è²ã 使ã£ã¦ã¿ããã¨ã«ãããæåã¯boost::lexical_cast 使ãæ¹ã¯ã¨ã£ã¦ãç°¡åã§ãC++å¼ã®ãã£ã¹ãã¨åãæ¸ãæ¹ã§æååâæ°å¤ãæ°å¤âæååã®å¤æãè¡ããèªä½ã¯ã©ã¹ã§ãåå¤æåã ããæ¼ç®åâ¦
2012/3/19è¿½è¨ ãã®è¨äºã®æ å ±ã¯C++03ã®ãã®ã§ããC++11ã§ã¯PODåã®å®ç¾©ãç°ãªã£ã¦ãã¾ããPODï¼Plain Old Data)åã¨ã¯ã³ã³ã¹ãã©ã¯ã¿ãã³ã³ãã¤ã©ãèªåçæããããã©ã«ãã³ã³ã¹ãã©ã¯ã¿ããæãããªãåã®ãã¨ã§ããintåãdoubleåãªã©ã®çµã¿è¾¼ã¿åãã¾â¦