pybind11/docs
Dean Moldovan 03f627ebb1 Make reference(_internal) the default return value policy for properties (#473)
* Make reference(_internal) the default return value policy for properties

Before this, all `def_property*` functions used `automatic` as their
default return value policy. This commit makes it so that:

 * Non-static properties use `reference_interal` by default, thus
   matching `def_readonly` and `def_readwrite`.

 * Static properties use `reference` by default, thus matching
   `def_readonly_static` and `def_readwrite_static`.

In case `cpp_function` is passed to any `def_property*`, its policy will
be used instead of any defaults. User-defined arguments in `extras`
still have top priority and will override both the default policies and
the ones from `cpp_function`.

Resolves #436.

* Almost always use return_value_policy::move for rvalues

For functions which return rvalues or rvalue references, the only viable
return value policies are `copy` and `move`. `reference(_internal)` and
`take_ownership` would take the address of a temporary which is always
an error.

This commit prevents possible user errors by overriding the bad rvalue
policies with `move`. Besides `move`, only `copy` is allowed, and only
if it's explicitly selected by the user.

This is also a necessary safety feature to support the new default
return value policies for properties: `reference(_internal)`.
2016-11-01 11:44:57 +01:00
..
_static documentation improvements 2016-04-26 23:48:55 +02:00
advanced Make reference(_internal) the default return value policy for properties (#473) 2016-11-01 11:44:57 +01:00
basics.rst Reorganize documentation 2016-10-20 15:21:34 +02:00
benchmark.py Much more efficient generation of function signatures, updated docs 2016-01-17 22:31:15 +01:00
benchmark.rst ..mention in benchmark docs as well 2016-08-19 09:38:14 +02:00
changelog.rst Make reference(_internal) the default return value policy for properties (#473) 2016-11-01 11:44:57 +01:00
classes.rst Document dynamic attributes 2016-10-14 01:16:40 +02:00
compiling.rst minor doc & style fixes 2016-09-06 13:02:29 +09:00
conf.py Fix sphinx doc missing code blocks and warnings 2016-08-16 01:30:58 +02:00
faq.rst Remove obsolete example reference (#457) 2016-10-22 18:54:33 +02:00
index.rst Reorganize documentation 2016-10-20 15:21:34 +02:00
intro.rst ..one more typo 2016-09-21 19:30:23 +02:00
limitations.rst Multiple inheritance support 2016-09-19 13:45:31 +02:00
Makefile took a stab at some documentation 2015-10-13 03:16:44 +02:00
pybind11_vs_boost_python1.png documentation improvements 2016-04-28 15:32:07 +02:00
pybind11_vs_boost_python1.svg Much more efficient generation of function signatures, updated docs 2016-01-17 22:31:15 +01:00
pybind11_vs_boost_python2.png documentation improvements 2016-04-28 15:32:07 +02:00
pybind11_vs_boost_python2.svg Much more efficient generation of function signatures, updated docs 2016-01-17 22:31:15 +01:00
pybind11-logo.png Very minor documentation fixes, updated logo 2016-01-17 22:31:15 +01:00
reference.rst Reorganize documentation 2016-10-20 15:21:34 +02:00
release.rst updated changelog with v1.8.1, updated release instructions 2016-07-12 18:03:17 +02:00