mirror of
https://github.com/boostorg/python.git
synced 2026-01-22 17:32:55 +00:00
This commit was generated by cvs2svn to compensate for changes in r315,
which included commits to RCS files with non-trunk default branches. [SVN r7932]
This commit is contained in:
30
errors.h
Normal file
30
errors.h
Normal file
@@ -0,0 +1,30 @@
|
||||
// (C) Copyright David Abrahams 2000. Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
//
|
||||
// The author gratefully acknowleges the support of Dragon Systems, Inc., in
|
||||
// producing this work.
|
||||
|
||||
#ifndef ERRORS_DWA052500_H_
|
||||
# define ERRORS_DWA052500_H_
|
||||
|
||||
namespace py {
|
||||
|
||||
struct ErrorAlreadySet {};
|
||||
struct ArgumentError : ErrorAlreadySet {};
|
||||
|
||||
// Handles exceptions caught just before returning to Python code.
|
||||
void handle_exception();
|
||||
|
||||
template <class T>
|
||||
T* expect_non_null(T* x)
|
||||
{
|
||||
if (x == 0)
|
||||
throw ErrorAlreadySet();
|
||||
return x;
|
||||
}
|
||||
|
||||
} // namespace py
|
||||
|
||||
#endif // ERRORS_DWA052500_H_
|
||||
Reference in New Issue
Block a user