Debian Codegraph @

cmake/cxx_tests/have_freeze_sstream.cpp

raw
1 // DESCRIPTION
2 //
3 // Check if the compiler has (need) freeze method call in stringstream/
4 // strstream. Seems that Win32 and STLPort have it, libstdc++ not ...
5 // In sync with AC_CXX_HAVE_FREEZE_SSTREAM (2008-04-12).
6 //
7 // COPYLEFT
8 //
9 // Copyright (c) 2009 Theo Papadopoulo <[email protected]>
10 // Copyright (c) 2008 Alain BARBET <[email protected]>
11 //
12 // This program is free software; you can redistribute it and/or modify it
13 // under the terms of the GNU General Public License as published by the
14 // Free Software Foundation; either version 2 of the License, or (at your
15 // option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
20 // Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License along
23 // with this program. If not, see <http://www.gnu.org/licenses/>.
24 //
25 // As a special exception, the respective Autoconf Macro's copyright owner
26 // gives unlimited permission to copy, distribute and modify the configure
27 // scripts that are the output of Autoconf when processing the Macro. You
28 // need not follow the terms of the GNU General Public License when using
29 // or distributing such scripts, even though portions of the text of the
30 // Macro appear in them. The GNU General Public License (GPL) does govern
31 // all other use of the material that constitutes the Autoconf Macro.
32 //
33 // This special exception to the GPL applies to versions of the Autoconf
34 // Macro released by the Autoconf Macro Archive. When you make and
35 // distribute a modified version of the Autoconf Macro, you may extend this
36 // special exception to the GPL to apply to your modified version as well.
37
38 #include <sstream>
39 using namespace std;
40
41 int main() {
42 # ifdef HAVE_SSTREAM
43 stringstream message;
44 # else
45 strstream message;
46 # endif
47 message << "Hello";
48 message.freeze(0);
49 return 0;
50 }