2013-01-01ãã1å¹´éã®è¨äºä¸è¦§
ä»å¹´ã¯ä»ã¾ã§ä¸çªããã°æ¸ãã¾ããã åãã¦åå¼·ä¼ã«åå ããã¾ããã å 許ãåãã¾ããã ã¤ã³ã¿ã¼ã³ãçµé¨ãã¾ããã ããããªçµé¨ãç©ããã¨ãåºæ¥ã¾ããã æ¥å¹´ãè²ããªãã¨ãçµé¨ãã¦ããããã§ãã ãã¨ã²ã¼ã ä½ããããªã⦠è¯ããå¹´ã
using宣è¨ã¯æ¢ã«å®£è¨æ¸ã¿ã®ååã ããç¾å¨ã®ã¹ã³ã¼ãã«åãè¾¼ã¿ã¾ãã #include <iostream> namespace A { void f(double) { std::cout << "f(double)" << std::endl; } } using A::f; namespace A { void f(int) { std::cout << "f(int)" << std::endl; } } int main(</iostream>â¦
å æ¥ã®è¨äºã«ã¦ãC++ã«ã©ã ãå¼ã®å帰é¢æ°ã欲ããã¨æ¸ããã®ã§ããã調ã¹ããstackoverflowã«ã©ã ãå¼ã§ã®å帰é¢æ°ãå®ç¾ãããã¨ãã¦ããã³ã¼ããããã¾ããã #include <functional> #include <iostream> int main() { std::function<int (int)> fact; fact = [&fact](int n){ return n == </int></iostream></functional>â¦
C#æ¸ãã¦ãã¦ãããC++ã«ã欲ãããªããã¨æã£ãããæ®éã«ããããæ©è½æ¬²ããã¨æã£ããã®ã§ãã ãã¹ãããåå空é ä»ã®C++ã§ã¯ããæ¸ããªãã¨ããã¾ããã namespace hoge { namespace foo { ... } } ãããæ¸ãããè¯ããªããã¨æãã¾ããã namespace â¦
â»12/19 è¿½è¨ è¨äºæ¸ãã¦æ°æ¥å ¬éããããè¨ããã欲ãã¹ãããªã®ã§æ¶ãã¾ãã
ä»å¹´èªãã æè¡æ¸ãã¾ã¨ãããã¨æãã¾ããå¹´æ«ãªã®ã§æ¯ãè¿ã£ã¦ã¿ããã¨æãã¾ãã ä»å¹´ã¯ããé»è»ã«ä¹ã£ãããã¦æãæ½°ãæ©ä¼ãå¤ãã£ãã®ã¨ãæèçã«ç©ã¿æ¬ãæ¶åãããã¨ãã¦ããã®ã§ããããèªã¿ã¾ãããï¼åèªãã ã ãã§ã¯å ¨ã¦ç解ããããªãã®ã§ãä½â¦
ãã«ãã¡ã½ãã3 åã¾ããæ¹è¯ç·¨ã®ç¶ãã§ãã basic_dispatcher flat_mapã使ã RTTI(å®è¡æåæ å ±)ã¨ãtype_index(typeinfoãæ¯è¼ã§ããããã«ã©ããããå)ã®2ã¤ããããã¨ã«ãããå ¨ã¦ã®åã«å¯¾ãã¦(ãã¡ããåçãªåãå«ã¿ã¾ã)ãé åºé¢ä¿ãæã¤ãã¨ãåºâ¦
STLã¢ã«ã´ãªãºã ã¯ãã®ã¢ã«ã´ãªãºã ãé©ç¨ããç¯å²ã®å é ã¨æ«å°¾ã®ã¤ãã¬ã¼ã¿ã®ãã¢ãå¼æ°ã«åãã¾ããå®éã«ã¯ç¯å²å ¨ä½ã«ã¢ã«ã´ãªãºã ãé©ç¨ãããã±ã¼ã¹ãå¤ããã¤ãã¬ã¼ã¿ã®ãã¢ãæ¸ãã®ãåé·ã«æãããã¨ãããã¾ããããã§Boost.Rangeã«ã¯ãç¯å²ãå¼æ°â¦
boost::shared_ptrãã·ãªã¢ã©ã¤ãºããéã«ããã£ãã®ã§ã¡ã¢ãã¦ããã¾ãã boost::shared_ptrã®ãã©ããã³ã°ã¬ãã«ã¯boost::shared_ptrã®åTã®ãã©ããã³ã°ã¬ãã«ã«ä¾åãã¦ãã¾ããããã¦ããã®åTã®ãã©ããã³ã°ã¬ãã«ã¯boost::serialization::track_neverâ¦
ããã©ã«ãã³ã³ã¹ãã©ã¯ã¿ãæããªãã¯ã©ã¹ãã·ãªã¢ã©ã¤ãºããã save_construct_dataã使ããã¨ããã£ãæ å ±ã¯åºã¦ããã®ã«ãèå¿ã®ã¢ã¼ã«ã¤ãåãããµã³ãã«ã³ã¼ããæ¢ããéãããã¾ãç¡ãã®ã§ããµã³ãã«å¼µã£ã¦ããã¾ããããã«ç¥ããããã¨ãæ¸ãã¦ããâ¦
MinGWã®gccã§boostã使ãããã£ãã®ã§ããã¡ãã®ãµã¤ããåèã« bootstrap.bat gcc ãå®è¡ãã¾ããããã㨠Building Boost.Build engine builtins.c: In function 'builtin_readlink': builtins.c:1879:39: error: 'FSCTL_GET_REPARSE_POINT' undeclared (fâ¦
Visual C++ Complier Nov 2013 CTPã«ã¦é¨åçã«å®è£ ãããconstexprã§ãããconstexpré¢æ°ã®ã³ã³ãã¤ã«æå帰深度ã«ã¤ãã¦èª¿ã¹ã¦ã¿ã¾ããã constexpr int func(int n) { return n == 0 ? 0 : func(n - 1); } int main() { static_assert(func(512) == 0, ""â¦
ã½ã¼ã¹ http://blogs.msdn.com/b/vcblog/archive/2013/11/18/announcing-the-visual-c-compiler-november-2013-ctp.aspx ã¤ãã«â¦ï¼ã¤ãã«â¦ï¼ããâ¦ï¼Visual C++ 2013 CTPã§ãï¼ ãªãã¨ãVisual C++ã§ãconstexprã使ãã¾ãï¼ï¼ï¼(ã³ã³ã¹ãã©ã¯ã¿é¤ã) ã³ã³ãâ¦
è£æ¬ åå ã ã£ãã®ã§ãåæ¥ã¾ã§ã«æ ã«å ¥ãã¦ã©ããã¼ã§ããã æ®æ®µããã°ãtwitterã§ä¸æ¹çã«ããç¥ã£ã¦ãã人ãã¡ã«çã§ä¼ããã¨ãããã¨ãç®çã®ä¸ã¤ã«åå ãã¦ãã¾ããã C++11 : variadic template ã®ãç´¹ä» çºè¡¨è εÏιÏÏημηãã è³æ http://www.slideshâ¦
以ä¸ã®ã³ã¼ããVisual C++ 12.0ã§ã³ã³ãã¤ã«ã¨ã©ã¼ã«ãªãã¾ããBoostã®ãã¼ã¸ã§ã³ã¯1.55ã§ãã #include <boost/iterator/iterator_concepts.hpp> int main() { } åºå http://melpon.org/wandbox/permlink/oJdAALJZbyRJgIiG iterator_concepts.hpp(43): error C2448: 'BOOST_concept' : é¢æ°ã®å®ç¾©</boost/iterator/iterator_concepts.hpp>â¦
clang3.4ã§åãã¾ããã #include <type_traits> #include <cassert> //é常ã®é¢æ°ã®æ»ãå¤ã®åæ¨è« template <class T, class U> constexpr auto add(T t, U u) { return t + u; } //constexpré¢æ°ã®å¶éç·©å constexpr int factorial(int n) { int sum = 1; for (int i = n; 0 < i; --i) { sum *= i</class></cassert></type_traits>â¦
ç°¡åãªãã£ããããã°ã©ã ãæ¸ãã¦ã¿ã¾ãããBoost.Asioã¨Winsock2ã®2éãæ¸ãã¦ã¿ã¾ãããã¨ã«ããç°¡åã«æ¸ããã¨ããã®ã§ãTCPã§ãåæéä¿¡ãã¦ãã¾ãããªã®ã§ãä¸æ¹çã«ã¡ãã»ã¼ã¸ãéããã¨ã¯ã§ãããå¿ ããµã¼ãå´ã¨ã¯ã©ã¤ã¢ã³ãå´ã交äºã«ã¡ãã»ã¼ã¸ãâ¦
N3450ãè¦ã¦ãéã¡ã³ãé¢æ°çã®to_index, to_iteratorãªãã¨ãªãæ¸ãã¦ã¿ã¾ãããæ¬å½ãªãã¯ã©ã¹ã®ã¡ã³ãé¢æ°ã§ãããæ°ã«ããã«â¦ã #include <iterator> #include <type_traits> template <class Container> auto to_index(const Container& container, typename Container::const_iterator it) -> d</class></type_traits></iterator>â¦
HTTPéä¿¡ãããããã°ã©ã ãæ¸ãã¦ã¿ã¾ãããWinScok2ã¨Boost.Asioã§ããããæ¸ãã¦ã¿ã¾ãããç°¡åã«ããããã«TCPã§åæéä¿¡ããããã°ã©ã ã§ããWinSockã®åèã«ãç«ã§ããããWindowsããã°ã©ãã³ã°ãã使ã£ãã®ã§ã¢ã¯ã»ã¹ãããã¼ã¸ããããªã£ã¦ãã¾ããâ¦
ãã®æ¹æ³ã§ãã¾ãããã¾ãããã·ã³ãã«ãªæ¹æ³ã§æ°ã«å ¥ã£ã¦ã¾ãã ãã¡ã
æè¿æ°ãããã¼ãPCãè³¼å ¥ãã¾ãããPCã¯VAIO Fit 14ãOSã¯Windows 8 64bitã§ããæ°ããPCãè²·ã£ã¦æåã«ä½ããããããã®ãããããã調ã¹ãªãããã£ãä½æ¥ãå¾ã®ããã«ã¡ã¢ãã¦ãããã¨æãã¾ããã ç®±ããåãåºããå è£ ãã¯ãã é åæ¸ã説ææ¸çãæ¸é¡â¦
å®ç¾ãããæ©è½ã決ãã¾ãã ãã®æ©è½ãå®è£ ããéã®å®è£ ã®é¸æè¢ãããªã·ã¼ã¨ãã¦æ½åºãã¾ãã å ±éã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ã§æ±ããããã«ããªã·ã¼ã®traitsãä½ãã¾ãã èªä½ããªã·ã¼ã«ç¹æ®åããtraitsãä½ãã¾ãã å®æ
boost::multiprecision::cpp_dec_float(以ä¸cpp_dec_float)ããboost::multiprecision::cpp_int(以ä¸cpp_int)ã¸ç´æ¥å¤æããæ¹æ³ã¯ããã¾ãããåæ§ã«cpp_intããcpp_dec_floatã¸ç´æ¥å¤æããæ¹æ³ã¯ããã¾ããã*1 cpp_intãcpp_dec_floatããæååã¸å¤æãâ¦
ãã«ãã¡ã½ãã2 åä»»ãç·¨ã®ç¶ãã§ããModern C++ Designã«è¼ã£ã¦ãããã«ãã¡ã½ãããèªåãªãã®è§£éãå ããªãããLokiã©ã¤ãã©ãªã§ã¯ãªãBoostã©ã¤ãã©ãªãç¨ãã¦å®è£ ãã¦ã¿ããã¨ãã試ã¿ã§ãã ååæ¸ããããã«ä»åã¯static_dispatcherã®æ¹è¯ã¨ãã¦ãâ¦
Visual Studio 2013 RCããªãªã¼ã¹ããã¾ããã C++ã好ããªèªåã¨ãã¦ã¯Previewããæ´ã«æ°ãã追å ãããC++11/14ã®æ©è½ãæ°ã«ãªãã¾ãã(èªåã¯C99ã«ã¤ãã¦ã¯åãããªãã®ã§è§¦ãã¦ãã¾ãã) ãã£ããPremiumçãã¤ã³ã¹ãã¼ã«ãã¦éãã§ã¿ã¾ããã #include <type_traits></type_traits>â¦
ãã¡ã æã£ã¦ããæ¬ãæã£ã¦ããªãæ¬æ··ãã£ã¦ã¾ããããã¤ãæãããæ¬ã§ãã
Lokiã®ãã«ãã¡ã½ããã©ã¤ãã©ãªã®å®è£ ãã©ããªã£ã¦ããã®ã調ã¹ã¦ç解ãã¤ã¤ãBoostãC++11ã§æ¸ããªããã¦ä½¿ããã¨ããç®çã å°ç¨ã®ã«ãã´ãªãä½ã£ã¦ãã«ãã´ãªãå¢ãã¦ç ©éã«ãªãã®ã§ãé¢é£ããè¨äºã¯ããããçºããè¨äºãä½ããã¨ã§çºãããã¨æãã¾ããâ¦
ååã®è¨äºã®SFINAEç
ã¯ã¦ãªããã°ã®Gistã®ã½ã¼ã¹ã³ã¼ãè²¼ãä»ããå ¬å¼ã§å¯¾å¿ããã®ã§ããã®è©¦ç¨ãå ¼ãã¦ã 好å¥å¿ã§ãããã£ãé¢æ°ãã³ãã¬ã¼ããä½ããããããªããã¨æã£ã¦ææ¦ãã¦ã¿ã¾ããã C++ã§ãã£ã¹ãã®ç¨®é¡ãã¨ã«é·ãååä»ããçç±ãèããã°ãã®ãããªé¢æ°ãã³ãã¬ã¼â¦
ãã¡ã URL