Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49449 - in sandbox/guigl: boost/parameter libs/guigl/example
From: stipe_at_[hidden]
Date: 2008-10-25 02:47:34


Author: srajko
Date: 2008-10-25 02:47:33 EDT (Sat, 25 Oct 2008)
New Revision: 49449
URL: http://svn.boost.org/trac/boost/changeset/49449

Log:
typed_keyword supports call operator to construct argument
Text files modified:
   sandbox/guigl/boost/parameter/typed_keyword.hpp | 17 ++++++++++++++++-
   sandbox/guigl/libs/guigl/example/window_example.cpp | 8 ++++----
   2 files changed, 20 insertions(+), 5 deletions(-)

Modified: sandbox/guigl/boost/parameter/typed_keyword.hpp
==============================================================================
--- sandbox/guigl/boost/parameter/typed_keyword.hpp (original)
+++ sandbox/guigl/boost/parameter/typed_keyword.hpp 2008-10-25 02:47:33 EDT (Sat, 25 Oct 2008)
@@ -39,7 +39,22 @@
     {
         return typed_tagged_argument_type(x);
     }
-
+
+ template<typename T0>
+ typed_tagged_argument_type const
+ operator()(const T0 &t0) const
+ { return typed_tagged_argument_type(typename Tag::value_type(t0)); }
+
+ template<typename T0, typename T1>
+ typed_tagged_argument_type const
+ operator()(const T0 &t0, const T1 &t1) const
+ { return typed_tagged_argument_type(typename Tag::value_type(t0, t1)); }
+
+ template<typename T0, typename T1, typename T2>
+ typed_tagged_argument_type const
+ operator()(const T0 &t0, const T1 &t1, const T2 &t2) const
+ { return typed_tagged_argument_type(typename Tag::value_type(t0, t1, t2)); }
+
  public: // Insurance against ODR violations
     
     // People will need to define these keywords in header files. To

Modified: sandbox/guigl/libs/guigl/example/window_example.cpp
==============================================================================
--- sandbox/guigl/libs/guigl/example/window_example.cpp (original)
+++ sandbox/guigl/libs/guigl/example/window_example.cpp 2008-10-25 02:47:33 EDT (Sat, 25 Oct 2008)
@@ -65,10 +65,10 @@
     
     widget::labeled_slider *s = new widget::labeled_slider((
         _label="Slider",
- _size=size_type(100,30),
- _position=position_type(50,80),
- _background=color_type(0.5,0.5,0.5),
- _active_color=color_type(0,1,0),
+ _size(100,30),
+ _position(50,80),
+ _background(0.5,0.5,0.5),
+ _active_color(0,1,0),
         _min=0.1,_max=0.9,_value=0.5,
         _step=0.1 ));
     test_window1 << s;


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