Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/boost/pool/detail/pool_construct_simple.m4 @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 2.7 KB
Line 
1m4_dnl
2m4_dnl Copyright (C) 2001 Stephen Cleary
3m4_dnl
4m4_dnl Distributed under the Boost Software License, Version 1.0. (See accompany-
5m4_dnl ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6m4_dnl
7m4_dnl See http://www.boost.org for updates, documentation, and revision history.
8m4_dnl
9m4_dnl
10m4_dnl
11m4_dnl Avoid the use of any m4_* identifiers in this header file,
12m4_dnl  as that may cause incompatibility problems with future
13m4_dnl  versions of m4.
14m4_dnl
15m4_dnl This is a normal header file, except that lines starting
16m4_dnl  with `m4_dnl' will be stripped, TBA_FOR
17m4_dnl  macros will be replaced with repeated text, and text in
18m4_dnl  single quotes (`...') will have their single quotes
19m4_dnl  stripped.
20m4_dnl
21m4_dnl
22m4_dnl Check to make sure NumberOfArguments was defined.  If it's not defined,
23m4_dnl  default to 3
24m4_dnl
25m4_ifdef(`NumberOfArguments', , `m4_errprint(m4___file__:m4___line__`: NumberOfArguments is not defined; defaulting to 3
26')m4_define(`NumberOfArguments', 3)')m4_dnl
27m4_ifelse(NumberOfArguments, , `m4_errprint(m4___file__:m4___line__`: NumberOfArguments is defined to be empty; defaulting to 3
28')m4_define(`NumberOfArguments', 3)')m4_dnl
29m4_dnl
30m4_dnl Check to make sure NumberOfArguments >= 1.  If it's not, then fatal error.
31m4_dnl
32m4_ifelse(m4_eval(NumberOfArguments < 1), 1, `m4_errprint(m4___file__:m4___line__`: NumberOfArguments ('NumberOfArguments`) is less than 1
33')m4_m4exit(1)')m4_dnl
34m4_dnl
35m4_dnl Include the BOOST_M4_FOR macro definition
36m4_dnl
37m4_include(`for.m4')`'m4_dnl
38m4_dnl
39m4_dnl Begin the generated file.
40m4_dnl
41// Copyright (C) 2000 Stephen Cleary
42//
43// This file can be redistributed and/or modified under the terms found
44//  in "copyright.html"
45// This software and its documentation is provided "as is" without express or
46//  implied warranty, and with no claim as to its suitability for any purpose.
47//
48// See http://www.boost.org for updates, documentation, and revision history.
49
50m4_dnl These warnings apply to the file generated from this file.
51m4_dnl Of course, you may freely edit this file.
52// This file was AUTOMATICALLY GENERATED from "m4___file__"
53//  Do NOT include directly!
54//  Do NOT edit!
55
56m4_dnl
57m4_dnl Here we go through the actual loop.  For each number of arguments from
58m4_dnl   1 to NumberOfArguments, we create a template function that takes that
59m4_dnl   many template arguments.
60m4_dnl
61BOOST_M4_FOR(N, 1, NumberOfArguments + 1,
62`template <BOOST_M4_FOR(i, 0, N, `typename T`'i', `, ')>
63element_type * construct(BOOST_M4_FOR(i, 0, N,
64    `const T`'i & a`'i', `, '))
65{
66  element_type * const ret = malloc();
67  if (ret == 0)
68    return ret;
69  try { new (ret) element_type(BOOST_M4_FOR(i, 0, N, `a`'i', `, ')); }
70  catch (...) { free(ret); throw; }
71  return ret;
72}
73')
Note: See TracBrowser for help on using the repository browser.