c++
c++ 㧠std::string 㨠std::wstring (ã¯ã¤ãæååç) ãç¸äºã«å¤æããã³ã¼ãã§ããããã¿ã¤ãå®£è¨ #include <string> std::wstring s2ws(const std::string& str); std::string ws2s(const std::wstring& wstr); å®è£ #include <string> #include <codecvt> std::wstring s2ws(cons</codecvt></string></string>â¦
C++ ã®SFINAE (Substitution Failure Is Not An Error)ã使ã£ã¦ï¼ã¯ã©ã¹ T ã« foo(int a, int b)ããããå¦ãã調ã¹ãæ¹æ³ã§ãï¼ ç°¡åãªä¾(class Tã« ãªã¼ãã¼ãã¼ããããé¢æ°ããªãå ´å) ã¾ãã¯ã·ã³ãã«ã«ï¼ã¯ã©ã¹ T ã«å¯¾ãã¦T::foo ãåå¨ãããã©ãã調â¦
ä¸è¬åéè¡åï¼æ¬ä¼¼éè¡åï¼æå°äºä¹æ³ã«å¯¾å¿ãããã¤ï¼ãc++ã§è¨ç®ãããµã³ãã«ç¹ç°å¤å解(SVD)ãå¿ è¦ãªã®ã§ï¼å®è£ 㯠Eigen ã使ãã¾ãpython/numpy ã®å®è£ ãç¨æãã¾ããï¼ãã¡ãã§ã https://pyopyopyo.hatenablog.com/entry/2021/09/14/161955 #include <Eigen/Dense></eigen/dense>â¦
/dev/null ã¿ãã㪠std::ostream ãä½ãæ¹æ³ï¼ æ¹æ³1 : std::ostreamãç¶æ¿ãã¦èªåã® null stream ãä½æãã 以ä¸ã®URLã§ç´¹ä»ããã¦ããæ¹æ³ stackoverflow.com #include <iostream> class NulStreambuf : public std::streambuf { char dummyBuffer[ 64 ]; protect</iostream>â¦
Cè¨èªãC++ã®æ¬ ç¹ã®ä¸ã¤ã¯ï¼ãããã¡ãªã¼ãã¼ããã¼ããªã¼ãã¼ã©ã³ãèµ·ããããããã¨ã§ãï¼ããã¯æ¬ ç¹ã§ããã¨åæã«C/C++ã®å©ç¹ã§ããã¨è¨ã人ããã¾ãï¼ã¤ã¾ãï¼ã¡ã¢ãªé¢é£ã®ãã§ãã¯ãçç¥ãããã¨ã§ï¼çç¥ããåC/C++ã¯ãªã¼ãããããå°ãªãé«éãªããâ¦
C++11ã使ãã¨ç¶ºéºã«å®è£ ã§ãã¾ã ã¾ã format() ã¨ãããã³ãã¬ã¼ãé¢æ°ãä½ãã¾ãï¼C++11ã§æ°ããå°å ¥ãããï¼å¯å¤å¼æ°ãã³ãã¬ã¼ãï¼ããã³ std::snprintf() ã使ãã¾ãï¼ #include <string> #include <cstdio> #include <vector> template <typename ... Args> std::string format(const std::string</typename></vector></cstdio></string>â¦
ä»æã®c++ (c++11ãªã©ï¼ã§ã³ãã¼ç¦æ¢ï¼ä»£å ¥ç¦æ¢ã®ã¯ã©ã¹ãä½ãæ¹æ³ template <class T> struct CRTPnoncopyable { CRTPnoncopyable(const CRTPnoncopyable&) = delete; CRTPnoncopyable& operator=(const CRTPnoncopyable &) = delete; }; class A : CRTPnoncopyable<A> </a></class>â¦
c++ã§ããã¤ã³ã¿ããã¯ã©ã¹åãååã調ã¹ãå¦çã¯ã以ä¸ã®ï¼ã¹ãããã§å®ç¾ã§ãã¾ã typeid(obj).name() ã§ååã®æååãåã abi::__cxa_demangle() 㧠demangle ãã ãµã³ãã«ã³ã¼ãã¯ä»¥ä¸ã®éã #include <typeinfo> #include <cxxabi.h> #include <iostream> int main() { class MyCl</iostream></cxxabi.h></typeinfo>â¦
boost ã® boost/progress.hpp ã使ãã°OK #include <boost/progress.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/thread/thread.hpp> int main(int argc,char *argv[]) { const unsigned long expected_count=100; boost::progress_display show_progress( expected_count ); for(int i=0; i</boost/thread/thread.hpp></boost/date_time/posix_time/posix_time.hpp></boost/progress.hpp>
boost-1.50.0 ã¸ä¹ãæãã¾ããï¼ç§»è¡æ¹æ³ãã¡ã¢ãã¾ãï¼ 1.50.0 ã§ã®å¤æ´ç®æ http://www.boost.org/users/history/version_1_50_0.html ã«ä¸è¦§ãããã¾ããï¼æ©è½è¿½å ã»ãã°ä¿®æ£ã»ä»æ§å¤æ´ã¨è²ã å¤ãã£ã¦ãã¾ãï¼ç¹ã«å¤§ããªå¤æ´ç¹ã¨ãã¦ã¯ï¼boost::filesysâ¦