Commit Graph

18 Commits

Author SHA1 Message Date
Jason Rhinelander
4e45e1805b Fix #283: don't print first arg of constructor
This changes the exception error message of a bad-arguments error to
suppress the constructor argument when the failure is a constructor.

This changes both the "Invoked with: " output to omit the object
instances, and rewrites the constructor signature to make it look
like a constructor (changing the first argument to the object name, and
removing the ' -> NoneType' return type.
2016-07-17 17:47:05 -04:00
Wenzel Jakob
fb0e2e5dac minor formatting fix 2016-07-01 14:54:24 +02:00
Dean Moldovan
f2b36c2ed2 Fix a couple of warnings
- Conversion warning on clang: 'long' to 'size_t'
- Unused variable warning on MSVC
2016-06-01 23:48:23 +02:00
Wenzel Jakob
38d8b8cfe2 don't allow registering a class twice (fixes #218) 2016-05-31 09:53:28 +02:00
Wenzel Jakob
86d825f330 Redesigned virtual call mechanism and user-facing syntax (breaking change!)
Sergey Lyskov pointed out that the trampoline mechanism used to override
virtual methods from within Python caused unnecessary overheads when
instantiating the original (i.e. non-extended) class.

This commit removes this inefficiency, but some syntax changes were
needed to achieve this. Projects using this features will need to make a
few changes:

In particular, the example below shows the old syntax to instantiate a
class with a trampoline:

class_<TrampolineClass>("MyClass")
    .alias<MyClass>()
    ....

This is what should be used now:

class_<MyClass, std::unique_ptr<MyClass, TrampolineClass>("MyClass")
    ....

Importantly, the trampoline class is now specified as the *third*
argument to the class_ template, and the alias<..>() call is gone. The
second argument with the unique pointer is simply the default holder
type used by pybind11.
2016-05-26 13:36:24 +02:00
Wenzel Jakob
3f200fab22 don't implicitly convert doubles to ints 2016-05-17 15:35:29 +02:00
Wenzel Jakob
bd57eb484d don't try to cast 'None' into a C++ lvalue reference 2016-05-01 14:42:20 +02:00
Wenzel Jakob
9059bd8134 added test for issue #70 2016-05-01 10:39:45 +02:00
Wenzel Jakob
d2b628bba4 added testcase for issue #187 2016-04-30 23:19:19 +02:00
Wenzel Jakob
e707497019 restructured code in issues.cpp 2016-04-30 22:44:00 +02:00
Wenzel Jakob
6ca6e82f7c fix various iterator issues (fixes #181) 2016-04-27 14:33:52 +02:00
Wenzel Jakob
dbe43ffcce completed implicit type casters for reference_wrapper 2016-04-21 12:21:14 +02:00
Wenzel Jakob
f54ded74f1 added caster for std::reference_wrapper (fixes #171) 2016-04-20 17:00:57 +02:00
Wenzel Jakob
8cb6cb33ef minor cleanups in common.h; updated author info and copyright year 2016-04-18 10:53:38 +02:00
Wenzel Jakob
1dc940d4b7 quenched -pendantic warnings (closes #167) 2016-04-18 10:41:44 +02:00
Wenzel Jakob
f5c154ade9 address issue with virtual function dispatch (fixes #159) 2016-04-11 18:13:08 +02:00
Wenzel Jakob
d3349af48b modularized logic in preceding change, fixed issue with char (fixes #150) 2016-03-26 23:04:10 +01:00
Wenzel Jakob
17cdb06c1b fix severe regression involving character arrays (fixes #137) 2016-03-10 13:24:10 +01:00