diff options
author | Martin Schulze <teebaum@cvs.gnome.org> | 2003-10-19 15:27:32 +0000 |
---|---|---|
committer | Martin Schulze <teebaum@src.gnome.org> | 2003-10-19 15:27:32 +0000 |
commit | 012d7c1863e929ba35e4797f89eb5ed840e300cc (patch) | |
tree | a0add862ed6155c28f59acf9101abfd423aafaf3 /tests/test_exception_catch.cc | |
parent | 0dcc02413bd3f8b917e87b57fa52365299c93a85 (diff) | |
download | sigc++-012d7c1863e929ba35e4797f89eb5ed840e300cc.tar.gz |
Add announces of versions 1.9.6 and 1.9.7. New file. Defines namespace
2003-10-19 Martin Schulze <teebaum@cvs.gnome.org>
* NEWS: Add announces of versions 1.9.6 and 1.9.7.
* sigc++/compatibility.h.m4: New file. Defines namespace SigC.
namespace SigC should be API compatible to libsigc++-1.2.
* sigc++/Makefile.am: Build compatibility.h.
* tests/test_compatibility.cc, tests/Makefile.am:
Add test case for compatibility module.
* docs/index.html: Change group names.
* sigc++/sigc++.h: Include connection.h.
* sigc++/connection.{cc,h}:
- Rename dependency to destroy_notify_callback.
- Change parameter name in set_slot() from d to data.
- Fix operator=(): Add "return *this;"
- Get rid of namespace functor.
- Corrections in documentation.
* sigc++/signal.{cc,h.m4}:
- Add reference counter to signal_impl. Replaces "bool destroy_".
- Move signal_base, slot_iterator[_buf], slot_list out of
namespace internal. They are part of the public API.
- Add convenience function signal#::make_slot().
- Get rid of namespace functor.
- Corrections in documentation.
* sigc++/trackable.{cc,h}:
- Rename dependency to destroy_notify_callback.
- Rename trackable::clear() to trackable::notify_callbacks().
- Corrections in documentation.
* sigc++/type_traits.h: Add documentation.
* sigc++/visit_each.h:
- Get rid of namespace functor.
- Add documentation.
* sigc++/adaptors[/lambda]/*: Get rid of namespace functor.
* sigc++/functors/{functor_trait.h,ptr_fun.h.m4,mem_fun.h.m4}:
- Get rid of namespace functor.
- Corrections in documentation / add documentation.
* sigc++/functors/slot.{cc,h.m4}:
- Move slot_base out of namespace internal. It's public API.
- Get rid of one-letter-parameter-names.
- Get rid of namespace functor.
- Corrections in documentation.
* tests/*.cc: Get rid of "using namespace ...".
Diffstat (limited to 'tests/test_exception_catch.cc')
-rw-r--r-- | tests/test_exception_catch.cc | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/tests/test_exception_catch.cc b/tests/test_exception_catch.cc index 1da6029..715043d 100644 --- a/tests/test_exception_catch.cc +++ b/tests/test_exception_catch.cc @@ -7,11 +7,8 @@ #include <iostream> #include <stdexcept> -using namespace std; -using namespace sigc::functor; - #ifndef SIGC_CXX_TYPEOF -struct f : public sigc::functor::functor_base +struct f : public sigc::functor_base { typedef int result_type; #else @@ -19,25 +16,25 @@ struct f { #endif int operator()(int i) - {cout << "f(int "<<i<<")"<<endl; + {std::cout << "f(int "<<i<<")"<<std::endl; throw std::range_error("out of range");} }; -struct g : public sigc::functor::functor_base +struct g : public sigc::functor_base { // also necessary if the compiler supports typeof() because the return type of // g's operator() overload with no arguments cannot be auto-detected in C++: typedef int result_type; int operator()() - {cout << "g()"<<endl; + {std::cout << "g()"<<std::endl; throw std::range_error("out of range");} }; -struct g_void : public sigc::functor::functor_base +struct g_void : public sigc::functor_base { typedef void result_type; void operator()() - {cout << "g_void()"<<endl; + {std::cout << "g_void()"<<std::endl; throw std::range_error("out of range");} }; @@ -49,7 +46,7 @@ struct my_catch try { throw; } catch (std::range_error e) // catch what types we know { - cerr << "caught "<< e.what() <<endl; + std::cerr << "caught "<< e.what() <<std::endl; } return 1; // all else continues out. @@ -59,7 +56,7 @@ struct my_catch int main() { - cout << exception_catch(f(), my_catch())(1) << endl; - cout << exception_catch(g(), my_catch())() << endl; - exception_catch(g_void(), my_catch())(); // void test + std::cout << sigc::exception_catch(f(), my_catch())(1) << std::endl; + std::cout << sigc::exception_catch(g(), my_catch())() << std::endl; + sigc::exception_catch(g_void(), my_catch())(); // void test } |