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