2. Getting Started
PrevŽ | Ž | Ž Next

## 2. Getting Started

### 2.1. Installing the library

¥é¥¤¥Ö¥é¥ê¤Ï¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Î¤ß¤Ç¹½À®¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢¥é¥¤¥Ö¥é¥ê¤òÍøÍÑ¤¹¤ë¤¿¤á¤ÎÆÃÊÌ¤Ê¼êÂ³¤¤Ï¤Ê¤¤¡£ ¤¿¤À¤·¡¢`boost` ¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Ç¥£¥ì¥¯¥È¥ê¤¬¥¤¥ó¥¯¥ë¡¼¥É¥Ñ¥¹¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ëÉ¬Í×¤¬¤¢¤ë¡£ °Ê²¼¤Î¤è¤¦¤Ë°Û¤Ã¤¿µ¡Ç½¤òÄó¶¡¤¹¤ë¿ô¡¹¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¡£
The library consists of include files only, hence there is no installation procedure. The `boost` include directory must be on the include path. There are a number of include files that give different functionality:

- `lambda/lambda.hpp` ¤ÏÍÍ¡¹¤Ê C++ ¤Î±é»»»Ò¤Î¤¿¤á¤Î¦Ë¼°¤òÄêµÁ¤·¤Æ¤¤¤ë¡£¾Ü¤·¤¯¤ÏSection 5.2¤ò¸«¤è¡£
  `lambda/lambda.hpp` defines lambda expressions for different C++ operators, see Section 5.2.

- `lambda/bind.hpp` ¤Ï9¸Ä¤Þ¤Ç¤Î°ú¿ô¤Î¤¿¤á¤Î `boost::bind` ´Ø¿ô¤òÄêµÁ¤·¤Æ¤¤¤ë¡£¾Ü¤·¤¯¤ÏSection 5.3¤ò¸«¤è¡£
  `lambda/bind.hpp` defines `bind` functions for up to 9 arguments, see Section 5.3.

- `lambda/if.hpp` ¤Ï if Ê¸¤ä¾ò·ï±é»»»Ò¤ÈÅù²Á¤Ê¦Ë´Ø¿ô¤òÄêµÁ¤·¤Æ¤¤¤ë¡£¾Ü¤·¤¯¤ÏSection 5.6¤ò¸«¤è¡£(`lambda.hpp` ¤â¸«¤ë¤³¤È¤òÁ¦¤á¤ë)¡£ `lambda/if.hpp` defines lambda function equivalents for if statements and the conditional operator, see Section 5.6 (includes `lambda.hpp`).

- `lambda/loops.hpp` ¤Ï·«¤êÊÖ¤·¹½Â¤¤ÈÅù²Á¤Ê¦Ë´Ø¿ô¤òÄêµÁ¤·¤Æ¤¤¤ë¡£¾Ü¤·¤¯¤ÏSection 5.6¤ò¸«¤è¡£ `lambda/loops.hpp` defines lambda function equivalent for looping constructs, see Section 5.6.

- `lambda/switch.hpp` ¤Ï switc Ê¸¤ÈÅù²Á¤Ê¦Ë´Ø¿ô¤òÄêµÁ¤·¤Æ¤¤¤ë¡£¾Ü¤·¤¯¤ÏSection 5.6¤ò¸«¤è¡£ `lambda/switch.hpp` defines lambda function equivalent for the switch statement, see Section 5.6.

- `lambda/construct.hpp` ¤Ï¥³¥ó¥¹¥È¥é¥¯¥¿¡¢¥Ç¥¹¥È¥é¥¯¥¿¡¢new ¤ä delete ¤ò¸Æ½Ð¤¹¦Ë¼°¤òµ½Ò¤¹¤ë¥Ä¡¼¥ë¤òÄó¶¡¤·¤Æ¤¤¤ë¡£¾Ü¤·¤¯¤ÏSection 5.8¤ò¸«¤è¡£(`lambda.hpp`¤â¸«¤ë¤³¤È¤òÁ¦¤á¤ë)¡£ `lambda/construct.hpp` provides tools for writing lambda expressions with constructor, destructor, new and delete invocations, see Section 5.8 (includes `lambda.hpp`).

- `lambda/casts.hpp` ¤Ï¦Ë´Ø¿ô¤Î¤¿¤á¤Î¡¢¥¥ã¥¹¥È¤ä `sizeof`¡¢`typeid` ¤òÄêµÁ¤·¤Æ¤¤¤ë¡£¾Ü¤·¤¯¤ÏSection 5.10.1¤ò¸«¤è¡£ `lambda/casts.hpp` provides lambda versions of different casts, as well as `sizeof` and `typeid`, see Section 5.10.1.

- `lambda/exceptions.hpp` ¤Ï¦Ë´Ø¿ôÆâ¤Ç¤ÎÎã³°¤òÁ÷½Ð¤·¤¿¤ê¡¢ÊäÂ¤¹¤ë¼êÃÊ¤òÄó¶¡¤¹¤ë¡£¾Ü¤·¤¯¤ÏSection 5.7¤ò¸«¤è¡£(`lambda.hpp`¤ò´Þ¤à) `lambda/exceptions.hpp` gives tools for throwing and catching exceptions within lambda functions, Section 5.7 (includes `lambda.hpp`).

- `lambda/algorithm.hpp` ¤È `lambda/numeric.hpp` (É¸½à¥é¥¤¥Ö¥é¥ê¤Î `algortihm` ¤È `numeric` ¥Ø¥Ã¥À¤ò»²¾È ) ¤Ï¥Í¥¹¥È¤·¤¿ STL ¥¢¥ë¥´¥ê¥º¥à¤Î¸Æ¤Ó½Ð¤·¤ò²ÄÇ½¤Ë¤¹¤ë¡£¾Ü¤·¤¯¤ÏSection 5.11¤ò¸«¤è¡£ `lambda/algorithm.hpp` and `lambda/numeric.hpp` (cf. standard `algortihm` and `numeric` headers) allow nested STL algorithm invocations, see Section 5.11.

°Ê¾å¤Ëµó¤²¤¿°Ê³°¤Î¥Ñ¥Ã¥±¡¼¥¸Æâ¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÏÆâÉôÅª¤Ë»ÈÍÑ¤·¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ë¡£¹¹¤Ë¡¢lambda ¥é¥¤¥Ö¥é¥ê¤Ï Tuple [tuple] ¤È type_traits [type_traits] ¤ÎÆó¤Ä¤Î Boost ¥é¥¤¥Ö¥é¥ê¤Ë°ÍÂ¸¤·¤Æ¤¤¤ë¡£¤½¤·¤Æ¡¢`boost/ref.hpp` ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ë¤â°ÍÂ¸¤¹¤ë¡£ Any other header files in the package are for internal use. Additionally, the library depends on two other Boost Libraries, the Tuple [tuple] and the type_traits [type_traits] libraries, and on the `boost/ref.hpp` header.

Á´¤Æ¤ÎÄêµÁ¤Ï `boost::lambda` ¥Í¡¼¥à¥¹¥Ú¡¼¥¹¤È¤½¤Î¥µ¥Ö¥Í¡¼¥à¥¹¥Ú¡¼¥¹¤ËÂ°¤¹¤ë¡£ All definitions are placed in the namespace `boost::lambda` and its subnamespaces.

### 2.2. Conventions used in this document

Â¿¤¯¤Î¥³¡¼¥ÉÎã¤Ç¤Ï¡¢`std` ¤È `boost::lambda` ¤ÎÌ¾Á°¶õ´Ö¤ÎÌ¾Á°¤ÎÀÜÆ¬¼¤ò¾ÊÎ¬¤·¤Æ¤¤¤ë¡£¤½¤Î¤¿¤á»ö¼Â¾å°ÅÌÛÅª¤Ë¡¢

    using namespace std;
    using namespace boost::lambda;

¤È¤¤¤¦ÄêµÁ¤¬¤¢¤ë¤È²¾Äê¤·¤Æ¤¤¤ë¡£

### 2.2. Conventions used in this document

In most code examples, we omit the namespace prefixes for names in the `std` and `boost::lambda` namespaces. Implicit using declarations

    using namespace std;
    using namespace boost::lambda;

are assumed to be in effect.

PrevŽ | Up | Ž Next
C++ BOOST The Boost Lambda LibraryŽ | Home | Ž 3. Introduction