Disallow implicit pointer conversion from rvalue smart pointers
This commit is contained in:
parent
7b0442e238
commit
9a36b82d5d
|
@ -453,7 +453,16 @@ class RAIIPHYSFS_File : public std::unique_ptr<PHYSFS_File, PHYSFS_File_deleter>
|
|||
public:
|
||||
DXX_INHERIT_CONSTRUCTORS(RAIIPHYSFS_File, base_t);
|
||||
using base_t::operator bool;
|
||||
operator PHYSFS_File *() const { return get(); }
|
||||
#ifdef DXX_HAVE_CXX11_REF_QUALIFIER
|
||||
operator PHYSFS_File *() const && = delete;
|
||||
#endif
|
||||
operator PHYSFS_File *() const
|
||||
#ifdef DXX_HAVE_CXX11_REF_QUALIFIER
|
||||
&
|
||||
#endif
|
||||
{
|
||||
return get();
|
||||
}
|
||||
int close()
|
||||
{
|
||||
/* Like reset(), but returns result */
|
||||
|
|
|
@ -120,6 +120,9 @@ public:
|
|||
{
|
||||
return operator[](static_cast<std::size_t>(i));
|
||||
}
|
||||
#ifdef DXX_HAVE_CXX11_REF_QUALIFIER
|
||||
operator pointer() const && = delete;
|
||||
#endif
|
||||
operator pointer() const
|
||||
#ifdef DXX_HAVE_CXX11_REF_QUALIFIER
|
||||
&
|
||||
|
|
Loading…
Reference in a new issue