[nostalgia/common] Make models noexcept
This commit is contained in:
parent
20a8d34e11
commit
0e73f75322
@ -4,7 +4,14 @@ add_library(
|
||||
bounds.cpp
|
||||
)
|
||||
|
||||
#install(TARGETS NostalgiaCommon DESTINATION lib)
|
||||
install(
|
||||
TARGETS
|
||||
NostalgiaCommon
|
||||
DESTINATION
|
||||
LIBRARY DESTINATION lib/nostalgia
|
||||
ARCHIVE DESTINATION lib/nostalgia
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
bounds.hpp
|
||||
|
@ -33,11 +33,11 @@ int Bounds::y2() const noexcept {
|
||||
}
|
||||
|
||||
Point Bounds::pt1() const noexcept {
|
||||
return Point(x, y);
|
||||
return {x, y};
|
||||
}
|
||||
|
||||
Point Bounds::pt2() const noexcept {
|
||||
return Point(x2(), y2());
|
||||
return {x2(), y2()};
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ class Bounds {
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
constexpr ox::Error model(T *io, Bounds *obj) {
|
||||
constexpr ox::Error model(T *io, Bounds *obj) noexcept {
|
||||
io->template setTypeInfo<Point>();
|
||||
oxReturnError(io->field("x", &obj->x));
|
||||
oxReturnError(io->field("y", &obj->y));
|
||||
|
@ -187,7 +187,7 @@ constexpr bool Point::operator!=(const Point &p) const noexcept {
|
||||
|
||||
|
||||
template<typename T>
|
||||
constexpr ox::Error model(T *io, Point *obj) {
|
||||
constexpr ox::Error model(T *io, Point *obj) noexcept {
|
||||
io->template setTypeInfo<Point>();
|
||||
oxReturnError(io->field("x", &obj->x));
|
||||
oxReturnError(io->field("y", &obj->y));
|
||||
|
@ -185,7 +185,7 @@ constexpr bool Size::operator!=(const Size &p) const noexcept {
|
||||
|
||||
|
||||
template<typename T>
|
||||
constexpr ox::Error model(T *io, Size *obj) {
|
||||
constexpr ox::Error model(T *io, Size *obj) noexcept {
|
||||
io->template setTypeInfo<Size>();
|
||||
oxReturnError(io->field("width", &obj->width));
|
||||
oxReturnError(io->field("height", &obj->height));
|
||||
|
Loading…
Reference in New Issue
Block a user