2012-06-01ãã1ã¶æéã®è¨äºä¸è¦§
ãã±ããã¢ã³ã¹ã¿ã¼ãã¯ã¤ã2è²·ã£ãã£ããä»ã®é²è¡åº¦ã¯1ã¤ãã®ã¸ã ã«æãã¨ãããææã¡ã¯ããããã(Lv8) ãã«ã(Lv13)ã®2å¹ããã£ããé²ãããã¨æãã¾ãããããã¾ããããããããããããï½ ã¬ãã«3ã4ã®ã¨ã¼ããªã¼ã¨ã¿ã¤ãã³ãã¦æ®éã«è² ãããã ããâ¦
æ¬ã®ä¾é¡ãboost::anyã®ç°¡æå®è£ ã ã£ãã®ã§ãè¦ãªããæ¸ãã¦ã¿ããã¤è²¼ãã #include <iostream> #include <typeinfo> using std::cout; using std::endl; class Any { public: //ããã©ã«ãã³ã³ã¹ãã©ã¯ã¿ Any(); //ãã³ãã¬ã¼ãã³ã³ã¹ãã©ã¯ã¿ template<class Type> Any(const Type& value)</class></typeinfo></iostream>â¦
ååã®è¨äºã®ç¶ãããã£ã±ãboost使ã£ã¦ãªãçãæ¸ãã¦ã¿ã #include <iostream> using std::cout; using std::endl; //åºåºã¯ã©ã¹ï¼ã¬ã³ãã class Gundam { }; //ã¬ã³ãã æ´¾çã¯ã©ã¹ï¼ã¨ã¯ã·ã¢ class Exia : public Gundam { }; //ã¬ã³ãã æ´¾çã¯ã©ã¹ï¼ã´ãã class </iostream>â¦
ä¾ã®ãã³ãã¬ã¼ãæ¬ï¼ä¸è¨ã®åèæç®åç §ï¼ã®SFINAEã®ç« ã®åå¼·ãã¦ããããã¯ã©ã¹ãç¹å®ã®åºåºã¯ã©ã¹ã®æ´¾çã¯ã©ã¹ãã©ããå¤å®ããããã°ã©ã æ¸ãã¦ã¿ãã ä»åã®å ´åã¯Gundamã¯ã©ã¹ãæ´¾çãã¦ããã©ãããã§ãã¯ããããã°ã©ã #include <iostream> #include <boost/utility.hpp> using n</boost/utility.hpp></iostream>â¦
Observerãã¿ã¼ã³ã®ç解ãæªããã£ãã®ã§ãµã³ãã«æ¸ãã¦ã¿ãã ããããã§ãã£ã¦ãã®ãï¼ï¼ #include <iostream> #include <string> #include <list> class IObserver; class ISubject { public: virtual void Push(IObserver* observer) = 0; virtual void Notify() = 0; }; class I</list></string></iostream>â¦
2次ãã¸ã§æ²ç·è²·ãã¦ã¿ããã¨æã£ããæè§ãªã®ã§èªä½ã®DirectXã©ããã©ã¤ãã©ãªã§æ¸ãã¦ã¿ãã #include <Frame.h> #include <Utility.h> #include <memory> #include <list> using namespace NekLib; using NekLib::Utility::DrawPoint; using NekLib::Utility::GetColor; #ifdef _DEBUG #prag</list></memory></utility.h></frame.h>â¦
C++ãã³ãã¬ã¼ããã¯ããã¯ãã£ã¦ãããSFINAEã®ç« ã®ãµã³ãã«ã³ã¼ãã« template<class T, size_t N> T* begin(T (&ar)[N]) { return ar; } ã¨ããè¨è¿°ããã£ããããã¯ãªãã ããï¼ã¨æã£ã¦ã°ã°ã£ããã¡ãã«ã¾ã¨ãã¦ãã£ãã</class>
ãã¡ããè¦ãã¨ãããããã¾ãæ¬å½ã¯æããªãã ã¼ãã»ãã³ãã£ã¯ã¹ - yohhoyã®æ¥è¨ï¼å¥é¤¨ï¼ æ¬ã®è«: rvalue reference å®å ¨è§£èª¬
èªåããã³ãã©ãªãªãã¸ã§ã¯ãã®å¯¿å½ã¨åç §ãå³è¾ºå¤åç §ãã¡ããã¨ç解ãã¦ããªãããè²ã 試ãã¦ã¿ãã å¤ãä»£å ¥ããå ´åãå³è¾ºå¤ã¨é¢æ°ã®æ»ãå¤ã§ã¯ãã¹ãã©ã¯ããããã¿ã¤ãã³ã°ãéãã¿ããï¼ #include <iostream> using namespace std; void Section(int n) { cout </iostream>â¦
æè§ãªã®ã§ããã°ã©ãã³ã°ã®è¨äºãæ¸ãã¦ã¿ããã¨æããããªã¢ã¼ãã£ãºã ã«ã¤ãã¦ããã£ããè¨ãã¨ãååã®é¢æ°ãåãæå±ãã¦ããã¯ã©ã¹ã«ãã£ã¦æ¯ãèããå¤åããããã¨ã ç¶æ¿ã«ãã£ã¦å®ç¾ã§ããã #include <iostream> class Parent { public: virtual void Show(</iostream>â¦
ç´5ã¶æã¶ãã®æ´æ° ã½ã¼ã¹ã³ã¼ããè²¼ããã¹ã<pre>ã¿ã°ã§è²¼ã£ã¦ã¿ã #include #include using namespace std;int main() { function f = [](int i){ return i * i; }; cout return 0; } >||ã¨||<ã§è²¼ã£ã¦ã¿ã #include <iostream> #include <functional> using namespace std; int main(</functional></iostream></pre>â¦