Not your computer? Use a private browsing window to sign in. Learn more about using Guest mode
Not your computer? Use a private browsing window to sign in. Learn more about using Guest mode
C/C++ã§ã¹ã¬ãããæ±ãå ´åã¯ããã©ãããã©ã¼ã ã«ãã£ã¦ä½¿ç¨ããã©ã¤ãã©ãªãéãã¾ãã Windows ãªã Windows API ã® thread ã§ã UNIX ã Linux ç³»ãªãã° pthread ã©ã¤ãã©ãªçã使ç¨ãã¾ãããã©ãããã©ã¼ã ä¾åããã³ã¼ãã¯å¯æ¬æ§ã«é£ãããã解決çã®1ã¤ã¨ãã¦ããªã³ã³ãã¤ã«ã§ä¾åé¨åããã©ãããã©ã¼ã ã«åãããã©ã¤ãã©ãªãé¸æãã¦ã³ã³ãã¤ã«ããæ¹æ³ãããã¾ãã boost ã©ã¤ãã©ãªã® boost::thread ã¯ãä¸ã®ãããªå¦çãã©ãããã¦å ±éã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ã¨ãã¦å®è£ ããã¦ãã¾ãã boost/thread.hppã®ä¸é¨ #if defined(BOOST_THREAD_PLATFORM_WIN32) #include <boost/thread/win32/thread.hpp> #elif defined(BOOST_THREAD_
shared_array class template shared_array ã¯ã©ã¹ãã³ãã¬ã¼ãã¯åçã«å²ãå½ã¦ãããé åã¸ã®ãã¤ã³ã¿ãä¿æããã (åçã«å²ãå½ã¦ãããé åã¨ã¯ãC++ ã® new[] ã«ãã£ã¦å²ãå½ã¦ããããã®ã§ããã) shared_array ã«æããããªãã¸ã§ã¯ãã¯ããã®ãªãã¸ã§ã¯ããæãæå¾ã® shared_array ãç ´æ£ãããã¯ãªã»ãããããã¨ãã«åé¤ããããã¨ãä¿è¨¼ãããã å ¨ã¦ã® shared_array ã¯C++æ¨æºã©ã¤ãã©ãªã® CopyConstructible (ã³ãã¼ã³ã³ã¹ãã©ã¯ãå¯è½)㨠Assignable (ä»£å ¥å¯è½)ã®æ¡ä»¶ãæºããã®ã§ãæ¨æºã©ã¤ãã©ãªã®ã³ã³ããã§ä½¿ããã¨ãã§ããã ã¾ããæ¨æºã©ã¤ãã©ãªã®é£æ³ã³ã³ããã§ä½¿ããã¨ãã§ããããã«ãæ¯è¼æ¼ç®åãæä¾ããã¦ããã é常ãshared_array 㯠new ã«ããå²ãå½ã¦ããã
Not your computer? Use a private browsing window to sign in. Learn more about using Guest mode
CodeZineç·¨éé¨ã§ã¯ãç¾å ´ã§æ´»èºãããããããã¼ãã¹ã¿ã¼ã«ããããã®ã«ã³ãã¡ã¬ã³ã¹ãDevelopers Summitãããã¨ã³ã¸ãã¢ã®çããã¾ããã¼ã¹ãããããã®ã¤ãã³ããDevelopers Boostããªã©ããã¾ãã¾ãªã«ã³ãã¡ã¬ã³ã¹ãä¼ç»ã»éå¶ãã¦ãã¾ãã
C++ ã§ä¹±æ°ãç¹ã«æ£è¦ä¹±æ°ã¨ã欲ãããªãã rand() é¢æ°ã¯ä½¿ã£ã¡ããã¡ï¼ã絶対ï¼ãã¨ãããã¨ãããã®ã§ãboost::random ã使ã£ã¦ã¿ãã ãããªãã§ã¡ããã£ã¨ä¹±æ°ã欲ãããããã§ãããªãããããã³ã¼ãæ¸ããªãã¨ãããªãã®ï¼ï¼ãã¨ããã¬ãããªãã»ã©è¤éã åãååãä½åº¦ãæ¸ãã®ã¨ããããµããµã§ãããâ¦â¦ ãªã®ã§ãæå°éã®æ±ç¨æ§ãæããã¤ã¤ã便å©ã§ãæ軽ã«ä½¿ããã©ããã¼ãæ¸ãã¦ã¿ãã #include <boost/random.hpp> template<class D, class G = boost::mt19937> class Rand { G gen_; D dst_; boost::variate_generator<G, D> rand_; public: Rand() : gen_(static_cast<unsigned long>(time(0))),
Not your computer? Use a private browsing window to sign in. Learn more about using Guest mode
Boost.åå¼·ä¼ #3 é¢è¥¿ Boost.æè¦ªä¼ #3 é¢è¥¿ ä»åã¯ããªã¼ã¸ã¹ç·ç æ§ãä¼å ´ã«éå¬ããã¦ããã ãã¾ããã é¢è¥¿ã§ã®Boost.åå¼·ä¼åéå¬ï¼ Boostã§3æ¥ã§ä½ãtwitterã¯ã©ã¤ã¢ã³ã(id:tt_clown, @tt_clown) åç» : http://www.ustream.tv/recorded/10395531 è³æ : 3æ¥ã§ä½ãtwitterã¯ã©ã¤ã¢ã³ãView more presentations from Tomoaki Tsugawa. Boostã§OAuthèªè¨¼ã¾ã§ããã«ã¯ãã¾ã ã¾ã é¨åã足ããªãããã§ããã HTTPéä¿¡ã¯ãä½ãã®ã¯ãããªã«é£ãããªãã§ããç¨æããã¦ãã»ãã楽ãªã®ã§ãBoost.Asioãã¼ã¹ã®ãããã¯ã¼ã¯ã©ã¤ãã©ãª( http://mikhailberis.github.com/cpp-netlib/ )ãæ©ãã»ããã¨ãã§ãã
2010/10/23 Boost.åå¼·ä¼ #3 é¢è¥¿ ãã¬ã¼ã³è³æ .pdf ã¨ãããã upload çRead less
sample ãµã³ãã«ã®åä½ç¢ºèªãã¼ã¸ã§ã³ [GCC4.4/1.41.0] [VC9/1.41.0] #include <string> #include <vector> #include <iostream> #include <boost/shared_ptr.hpp> using namespace std; int main() { typedef boost::shared_ptr<string> StrPtr; StrPtr s = StrPtr(new string("pen")); vector< StrPtr > v; // vectorã«å ¥ãããã v.push_back( StrPtr(new string("this")) ); v.push_back( StrPtr(new string("is")) ); v.push_back( StrPtr(new str
便å©ãªå°éå · ããã§ã¯ç¥ã£ã¦ããã¨ã¡ãã£ã¨å¾ããï¼ã¨æãããï¼ä¾¿å©ãªå°éå ·ãã¡ããç´¹ä»ãã¾ããç°¡åã«ï¼ãããæ軽ã«ä½¿ãããã®ãã¡ã°ãããç´¹ä»ãã¾ãã®ã§æ¯éã¨ããã¹ã¿ãã¦ãããããã®ã§ããå ·ä½çã«ã¯ä»¥ä¸ã®4ã¤ããç´¹ä»ãã¾ãã lexical_castãï¼ãæ°å¤ã¨æååã®ç¸äºå¤æ formatããããããï¼ãprintfã®ãããªå½¢å¼ã§ã®åºå timerãããããããï¼ãçµéæéã®è¨æ¸¬ foreachãããããï¼ãæ¡å¼µåforã«ã¼ã lexical_cast C++ã¯åã«å¯¾ãã¦å³ããè¨èªã ã¨è¨ããã¦ãã¾ãããªã®ã§ï¼åå¤æãããã¨ãã¯ããããã¨ç´°ããã¨ããã«æ°ãã¤ããªããã°ããã¾ããã§ããããããï¼ãã®lexical_castã使ç¨ããã°ï¼ãããã£ããããããããã解æ¾ãã¦ããã¾ãã以ä¸ã«ãµã³ãã«ã³ã¼ããè¼ãã¦ããã¾ãã #include <iostream> #include <strin
åå®ã«ã»ããã£ãåç §ã«ã¦ã³ãä»ãã¹ãã¼ããã¤ã³ã¿ ã¨ããããå®æã§ã ãã¤ãåæã«ãä¸è©±ã«ãªã£ã¦ãmeltããã®ã¨ãããããã£ã¦ããã®ã boost::shared_ptr風ã«ãã¦æ©è½æ¡å¼µãã¾ããã #include <functional> // less namespace shand { namespace detail { // shared_ptr<void>ãä½æããããã«åç §åä½æ template<class T> struct shared_ptr_traits { typedef T& reference; }; template<> struct shared_ptr_traits<void> { typedef void reference; }; #if !defined(_MSC_VER) || (_MSC_VER > 1300) // 1300 == VC++
ç§ã¯ãBoostã使ã£ã¦ãã§ã¯ãªããBoostãä½ã£ã¦ãåå¼·ãã¦ãã ä»äºã§ã¯Boostã使ãããã¦ã使ããªããã¨ãå¤ãã ãã (ãããªã¼ã®ã©ã¤ãã©ãªãªãã¦ä½¿ã£ã¡ããã¡ãã¨ãè¨ããã¦) ããã§ãBoostã®å¿ è¦ãªãã®ã®ã¿ãä½ã£ã¦ä½¿ç¨ãã¦ãã åæ©è½ããããã¼ãã¡ã¤ã«ï¼æ¬ã§æä¾ã§ããã®ã§ç§»æ¤ãããããã ãã ãã®ããã°ã§ç´¹ä»ãããã®ã以ä¸ã«ã¾ã¨ãã(â»éææ´æ°) ãBoostæ¬å®¶ã Boost C++ Libraries Boost C++ Libraries(cppllã«ãã翻訳) ãBoostããã®ç§»æ¤ã ã»shared_ptr åç §ã«ã¦ã³ãä»ãã¹ãã¼ããã¤ã³ã¿ ã»shared_array åç §ã«ã¦ã³ãä»ãã¹ãã¼ããã¤ã³ã¿ã®é åç ã»array åºå®é·é å ã»lexical_cast æ°å¤ã¨æååã®ç¸äºå¤æ ã»type_traits åç¹æ§ ã»scope_guard ã»static_as
Financial Instrument Pricing Using C++ (second edition) An integrated guide to C++ and computational finance This complete guide to C++ and computational finance is a follow-up and major extension to Daniel J. Duffy's 2004 edition of Financial Instrument Pricing Using C++. Both C++ and computational finance have evolved and changed dramatically in the last ten years and this book documents these i
photo credit: Emery_Way èªä½: #include <string> #include <vector> #include <iostream> #include <boost/foreach.hpp> /** * split é¢æ° * @param str  æåå * @param delim ããªãã¿ * @return åå²ãããæåå */ std::vector<std::string> split(std::string str, std::string delim) { std::vector<std::string > result; int start = 0, end; while ((end = str.find_first_of(delim, start)) != str.npos) { // if (end - start > 0) //
VCLã®AnsiStringãMFCã®CStringã¨æ¯ã¹ã¦ãC++æ¨æºã®æ±ç¨æååã¯ã©ã¹ã§ããstd::stringã¯æ©è½ã貧弱ãããã¤ãè£å®ããã®ãboostã®String Algorithms Libraryã 以ä¸ã¯ãã®ç°¡åãªä½¿ãæ¹ã 1.trim/trim_copy trimé¢æ°ã¯æååã®ä¸¡ç«¯ãã空ç½ãé¤å»ãããtrim_copyã¯ç©ºç½ãé¤å»ããçµæãè¿ããæååãã®ãã®ã«ã¯å½±é¿ãä¸ããªãã #include <string> #include <boost/algorithm/string.hpp> void foo() { std::string ss(" foo "); boost::trim(ss); }2.trim_if/trim_copy_if trim_ifã¯æååã®ä¸¡ç«¯ããæ¡ä»¶ãæºãããé¨åãé¤å»ãããtrim_copy_ifã¯trim_copyåæ§ãçµæã®ã¿ãè¿
æåã¯ã©ã¹ è§ã«ãã³ï¼[ ]ï¼ã§å²ã¾ããé¨åã¯æåã¯ã©ã¹è¡¨ç¾ã¨ãªãã¾ãã è§ã«ãã³ã§å²ã¾ããæåã¯ãããã®ããããã«ããããããã¨ããæå³ã«ãªãã¾ãã ä¾ãã°ã abc[ACD]123 ã¨ããæ£è¦è¡¨ç¾ã«å¯¾ãã¦ã¯ã abcA123 abcC123 abcD123 ã¯ããããã¾ããã abcAC123 abcX123 ãªã©ã¯ããããã¾ããã ã¾ããæåã¯ã©ã¹å ã§ã¯ãã¤ãã³ï¼-ï¼ãç¨ãã¦ãç¯å²ãã表ããã¨ãã§ãã¾ãã ä¾ãã°ã abc[3-8]123 ã¨ããæ£è¦è¡¨ç¾ã«å¯¾ãã¦ã¯ abc3123 abc4123 ... abc8123 ãããããã¾ãã ããã«ããããï¼^ï¼ãç¨ãã¦ãå¦å®ãã表ããã¨ãã§ãã¾ãã ä¾ãã°ã abc[^A-Z]123 ã¨ããæ£è¦è¡¨ç¾ã¯æåã¯ã©ã¹é¨åãã大æåã®ã¢ã«ãã¡ããã以å¤ã ã表ç¾ãã¦ããã®ã§ã abca123 abc%123 ãªã©ãããããã¾ããã abcX12
æ£è¦è¡¨ç¾ã©ã¤ãã©ãª âBoost Regex++â ã®ä½¿ãæ¹ âwebãä»ããããã°ã©ã ã®å®è¡âã¨ããã¢ããªã±ã¼ã·ã§ã³ã®æ°ããå½¢æ ãç¾ããperl,pythonãªã©ã«ä»£è¡¨ãããã¹ã¯ãªããè¨èªãããå©ç¨ãããããã«ãªãã¾ãããã¹ã¯ãªããè¨èªã®å¤ãã¯ããã¹ãããªãã¡æååãæ±ãã®ãå¾æã¨ãã¦ãã¾ãã ä¸æ¹C++ã¯æååãæ±ãã®ããã¾ãå¾æã§ã¯ããã¾ããã æè¿ã«ãªã£ã¦ããããæååã表ç¾ããã¯ã©ã¹std::basic_string ãæ¨æºã©ã¤ãã©ãªã«çµã¿å ¥ãããã¾ããã ããã«ãã£ã¦æååæä½ãé »ç¹ã«è¡ãããã¤ç§»æ¤æ§ã®é«ãã¢ããªã±ã¼ã·ã§ã³ã®å®è£ ãã¨ã¦ãããããããªãã¾ããã ããããªããæ¨æºã®æååãæã«å ¥ããC++ã§ãperlãªã©ã®ã¹ã¯ãªããè¨èªã«ããªããªããã¨ã®ä¸ã¤ãâæ£è¦è¡¨ç¾(regular expression)âã§ãã ãã¨ãã°Webã®èªåå·¡åãè¡ãã¢ããªã±ã¼ã·ã§ã³ãèãã¦ã¿ã¾ããã
C++ ç¨ã®ã©ã¤ãã©ãªï¼æ±ç¨çãªã©ã¤ãã©ãªã®å°ãªãã£ãï¼ C++ ã«ã¨ã£ã¦ï¼ããã®ãããã§éçºããããããªã£ãã¨ãã£ã¦ãéè¨ã§ã¯ãªãï¼ãã¶ãï¼ããã§ã¯Boostã«é¢ãã詳ãã説æã¯çãã®ã§ï¼ä¸è¨ã®åèæ¸ãªã©ãåèã«ãã¦ãããããï¼ æ¬ãã¼ã¸ã§ã¯ï¼Boostãç¨ãããããã¯ã¼ã¯ã®ä¸å¿æ§ã®è¨ç®ãæ¹æ³ã«ã¤ãã¦èª¬æããï¼ ãããã¯ã¼ã¯ã®ä¸å¿æ§ã¨ã¯ï¼ããè¦ç´ éåã¨ï¼åã ã®è¦ç´ éã®é¢ä¿æ§ããæ§æããããããã¯ã¼ã¯ã«ããã¦ï¼ãã®ãããã¯ã¼ã¯ã«ãããåè¦ç´ ã®éè¦æ§ã示ãææ¨ã¨ãã¦ï¼æ§ã ãªãã®ãæ示ããã¦ããï¼ãã®ãããã¯ã¼ã¯ã®ä¸å¿æ§ã¯ï¼ãããã¯ã¼ã¯åæãè¤éç³»ãããã¯ã¼ã¯ã«ããã¦éè¦ãªè¦ç´ ã§ãããï¼ç§èªèº«ãå§ããå½æï¼å¤§è¦æ¨¡ãªãããã¯ã¼ã¯ã対象ã¨ããã©ã¤ãã©ãªããã¼ã«ã¯æä¾ããã¦ããªãã£ãï¼ããã§ï¼å®éã«ãããã¯ã¼ã¯ãã¼ã¿ãããã°ã©ã ã§æ±ããã¨ä½æãã¯ããã¦è¦ãã¨ããï¼ãã¼ã¿æ§é ã管çï¼æ¢ç´¢ãªã©çµæ§é¢åã§
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}