Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71981 - sandbox/local/libs/local/example
From: lorcaminiti_at_[hidden]
Date: 2011-05-16 11:23:22


Author: lcaminiti
Date: 2011-05-16 11:23:21 EDT (Mon, 16 May 2011)
New Revision: 71981
URL: http://svn.boost.org/trac/boost/changeset/71981

Log:
Added WITH_DEFAULT example also for sequencing macro syntax.
Added:
   sandbox/local/libs/local/example/add_x_y_default_with.cpp (contents, props changed)

Added: sandbox/local/libs/local/example/add_x_y_default_with.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/example/add_x_y_default_with.cpp 2011-05-16 11:23:21 EDT (Mon, 16 May 2011)
@@ -0,0 +1,22 @@
+
+// Copyright (C) 2009-2011 Lorenzo Caminiti
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
+// copy at http://www.boost.org/LICENSE_1_0.txt).
+
+//[ add_x_y_default_with_cpp
+#include <boost/local/function.hpp>
+#include <iostream>
+
+#define WITH_DEFAULT )(default // For default parameters.
+
+int main() {
+ int BOOST_LOCAL_FUNCTION_PARAMS( (int x) (int y WITH_DEFAULT 2) ) {
+ return x + y;
+ } BOOST_LOCAL_FUNCTION_NAME(add)
+
+ std::cout << add(1) << std::endl;
+ return 0;
+}
+//]
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk