Skip to content

Commit

Permalink
Fix compile errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
cfis committed Mar 5, 2025
1 parent 7e29a77 commit 5cff1ac
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 34 deletions.
44 changes: 22 additions & 22 deletions include/rice/rice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3783,6 +3783,27 @@ namespace Rice
}
} // Rice

// ========= Constructor.hpp =========

namespace Rice
{
//! Define a Type's Constructor and it's arguments.
/*! E.g. for the default constructor on a Type:
\code
define_class<Test>()
.define_constructor(Constructor<Test>());
\endcode
*
* The first template argument must be the type being wrapped.
* Additional arguments must be the types of the parameters sent
* to the constructor.
*
* For more information, see Rice::Data_Type::define_constructor.
*/
template<typename T, typename...Arg_Ts>
class Constructor;
}

// ========= PointerView.hpp =========

namespace Rice
Expand Down Expand Up @@ -3940,7 +3961,7 @@ namespace Rice::detail
Module rb_mRice = define_module("Rice");

Data_Type<PointerView_T> result = define_class_under<PointerView_T>(rb_mRice, klassName).
define_constructor(Constructor<PointerView_T, PointerView_T::type*>()).
define_constructor(Constructor<PointerView_T, typename PointerView_T::type*>()).
define_attr("size", &PointerView_T::size).
define_method("dereference", &PointerView_T::operator*).
template define_method<VALUE(PointerView_T::*)(size_t, size_t)>("read", &PointerView_T::read, Return().setValue()).
Expand Down Expand Up @@ -13006,27 +13027,6 @@ namespace Rice::detail
return TypedData_Wrap_Struct(klass, Data_Type<T>::ruby_data_type(), nullptr);
}
}
// ========= Constructor.hpp =========

namespace Rice
{
//! Define a Type's Constructor and it's arguments.
/*! E.g. for the default constructor on a Type:
\code
define_class<Test>()
.define_constructor(Constructor<Test>());
\endcode
*
* The first template argument must be the type being wrapped.
* Additional arguments must be the types of the parameters sent
* to the constructor.
*
* For more information, see Rice::Data_Type::define_constructor.
*/
template<typename T, typename...Arg_Ts>
class Constructor;
}

// ========= Constructor.ipp =========
namespace Rice
{
Expand Down
10 changes: 5 additions & 5 deletions include/rice/stl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ namespace Rice::detail
class Wrapper<std::shared_ptr<T>> : public WrapperBase
{
public:
Wrapper(std::shared_ptr<T>& data);
Wrapper(const std::shared_ptr<T>& data);
~Wrapper();
void* get() override;
std::shared_ptr<T>& data();
Expand Down Expand Up @@ -1415,7 +1415,7 @@ namespace Rice

Identifier id(klassName);
Data_Type<T> result = define_class_under<T>(rb_mStd, id).
define_constructor(Constructor<T, T::element_type*>(), Arg("value").takeOwnership());
define_constructor(Constructor<T, typename T::element_type*>(), Arg("value").takeOwnership());

return result;
}
Expand All @@ -1425,7 +1425,7 @@ namespace Rice
namespace Rice::detail
{
template<typename T>
inline Wrapper<std::shared_ptr<T>>::Wrapper(std::shared_ptr<T>& data)
inline Wrapper<std::shared_ptr<T>>::Wrapper(const std::shared_ptr<T>& data)
: data_(data)
{
}
Expand Down Expand Up @@ -2059,7 +2059,7 @@ namespace Rice::detail
class Wrapper<std::unique_ptr<T>> : public WrapperBase
{
public:
Wrapper(std::unique_ptr<T>& data);
Wrapper(std::unique_ptr<T>&& data);
~Wrapper();
void* get() override;
std::unique_ptr<T>& data();
Expand All @@ -2078,7 +2078,7 @@ namespace Rice::detail
namespace Rice::detail
{
template<typename T>
inline Wrapper<std::unique_ptr<T>>::Wrapper(std::unique_ptr<T>& data)
inline Wrapper<std::unique_ptr<T>>::Wrapper(std::unique_ptr<T>&& data)
: data_(std::move(data))
{
}
Expand Down
2 changes: 1 addition & 1 deletion rice/PointerView.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ namespace Rice::detail
Module rb_mRice = define_module("Rice");

Data_Type<PointerView_T> result = define_class_under<PointerView_T>(rb_mRice, klassName).
define_constructor(Constructor<PointerView_T, PointerView_T::type*>()).
define_constructor(Constructor<PointerView_T, typename PointerView_T::type*>()).
define_attr("size", &PointerView_T::size).
define_method("dereference", &PointerView_T::operator*).
template define_method<VALUE(PointerView_T::*)(size_t, size_t)>("read", &PointerView_T::read, Return().setValue()).
Expand Down
2 changes: 1 addition & 1 deletion rice/rice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
// To / From Ruby
#include "Arg.ipp"
#include "Return.ipp"
#include "Constructor.hpp"
#include "PointerView.hpp"
#include "PointerView.ipp"
#include "detail/to_ruby.ipp"
Expand Down Expand Up @@ -131,7 +132,6 @@
#include "Director.hpp"
#include "Data_Type.ipp"
#include "detail/default_allocation_func.ipp"
#include "Constructor.hpp"
#include "Constructor.ipp"
#include "Callback.hpp"
#include "Callback.ipp"
Expand Down
2 changes: 1 addition & 1 deletion rice/stl/shared_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Rice::detail
class Wrapper<std::shared_ptr<T>> : public WrapperBase
{
public:
Wrapper(std::shared_ptr<T>& data);
Wrapper(const std::shared_ptr<T>& data);
~Wrapper();
void* get() override;
std::shared_ptr<T>& data();
Expand Down
4 changes: 2 additions & 2 deletions rice/stl/shared_ptr.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Rice

Identifier id(klassName);
Data_Type<T> result = define_class_under<T>(rb_mStd, id).
define_constructor(Constructor<T, T::element_type*>(), Arg("value").takeOwnership());
define_constructor(Constructor<T, typename T::element_type*>(), Arg("value").takeOwnership());

return result;
}
Expand All @@ -34,7 +34,7 @@ namespace Rice
namespace Rice::detail
{
template<typename T>
inline Wrapper<std::shared_ptr<T>>::Wrapper(std::shared_ptr<T>& data)
inline Wrapper<std::shared_ptr<T>>::Wrapper(const std::shared_ptr<T>& data)
: data_(data)
{
}
Expand Down
2 changes: 1 addition & 1 deletion rice/stl/unique_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Rice::detail
class Wrapper<std::unique_ptr<T>> : public WrapperBase
{
public:
Wrapper(std::unique_ptr<T>& data);
Wrapper(std::unique_ptr<T>&& data);
~Wrapper();
void* get() override;
std::unique_ptr<T>& data();
Expand Down
2 changes: 1 addition & 1 deletion rice/stl/unique_ptr.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Rice::detail
{
template<typename T>
inline Wrapper<std::unique_ptr<T>>::Wrapper(std::unique_ptr<T>& data)
inline Wrapper<std::unique_ptr<T>>::Wrapper(std::unique_ptr<T>&& data)
: data_(std::move(data))
{
}
Expand Down

0 comments on commit 5cff1ac

Please sign in to comment.