Jason Rhinelander
3f1ff3f4d1
Adds automatic casting on assignment of non-pyobject types ( #551 )
...
This adds automatic casting when assigning to python types like dict,
list, and attributes. Instead of:
dict["key"] = py::cast(val);
m.attr("foo") = py::cast(true);
list.append(py::cast(42));
you can now simply write:
dict["key"] = val;
m.attr("foo") = true;
list.append(42);
Casts needing extra parameters (e.g. for a non-default rvp) still
require the py::cast() call. set::add() is also supported.
All usage is channeled through a SFINAE implementation which either just returns or casts.
Combined non-converting handle and autocasting template methods via a
helper method that either just returns (handle) or casts (C++ type).
2016-12-12 23:42:52 +01:00
..
2016-11-15 12:38:05 +01:00
2016-11-20 21:21:54 +01:00
2016-11-06 19:12:48 +01:00
2016-09-06 13:02:29 +09:00
2016-12-12 23:42:52 +01:00
2016-09-07 01:25:27 +02:00
2016-09-09 03:04:09 -04:00
2016-11-20 21:21:54 +01:00
2016-09-03 17:34:41 -04:00
2016-08-19 13:19:38 +02:00
2016-09-06 16:41:50 +02:00
2016-09-19 13:43:43 +02:00
2016-09-13 20:40:28 +10:00
2016-11-20 21:21:54 +01:00
2016-10-20 16:19:58 +02:00
2016-11-20 21:21:54 +01:00
2016-12-08 11:07:52 +01:00
2016-12-08 11:07:52 +01:00
2016-11-17 11:01:11 +01:00
2016-11-20 21:21:54 +01:00
2016-11-15 12:38:05 +01:00
2016-11-20 21:21:54 +01:00
2016-12-12 23:42:52 +01:00
2016-08-25 17:08:09 +02:00
2016-11-17 23:24:47 +01:00
2016-11-20 21:21:54 +01:00
2016-11-20 21:21:54 +01:00
2016-09-10 12:08:32 +02:00
2016-08-19 16:31:48 +02:00
2016-12-12 23:42:52 +01:00
2016-11-20 21:21:54 +01:00
2016-11-17 08:55:42 +01:00
2016-11-17 08:55:42 +01:00
2016-12-12 23:42:52 +01:00
2016-11-22 11:28:40 +01:00
2016-09-07 01:25:27 +02:00
2016-11-20 21:21:54 +01:00
2016-09-06 16:41:50 +02:00
2016-09-19 13:43:43 +02:00
2016-12-08 11:07:52 +01:00
2016-12-08 11:07:52 +01:00
2016-09-03 17:34:41 -04:00
2016-08-19 13:19:38 +02:00
2016-10-20 16:19:58 +02:00
2016-11-20 21:21:54 +01:00
2016-11-17 08:55:42 +01:00
2016-11-20 21:21:54 +01:00
2016-11-22 22:01:03 +01:00
2016-11-22 22:01:03 +01:00
2016-09-07 01:25:27 +02:00
2016-08-19 13:19:38 +02:00
2016-09-03 17:34:41 -04:00
2016-09-19 13:43:43 +02:00
2016-09-03 17:34:41 -04:00
2016-08-19 13:19:38 +02:00
2016-10-11 22:13:02 +02:00
2016-10-11 22:13:02 +02:00
2016-12-12 23:42:52 +01:00
2016-12-12 23:42:52 +01:00
2016-11-13 10:41:31 +09:00
2016-11-20 21:21:54 +01:00
2016-12-07 02:36:44 +01:00
2016-12-07 02:36:44 +01:00
2016-11-15 12:30:38 +01:00
2016-11-20 21:21:54 +01:00
2016-09-11 01:21:53 -04:00
2016-11-20 21:21:54 +01:00