[nostalgia/common] Make models noexcept

This commit is contained in:
Gary Talent 2021-12-11 19:15:09 -06:00
parent 20a8d34e11
commit 0e73f75322
5 changed files with 13 additions and 6 deletions

View File

@ -4,7 +4,14 @@ add_library(
bounds.cpp bounds.cpp
) )
#install(TARGETS NostalgiaCommon DESTINATION lib) install(
TARGETS
NostalgiaCommon
DESTINATION
LIBRARY DESTINATION lib/nostalgia
ARCHIVE DESTINATION lib/nostalgia
)
install( install(
FILES FILES
bounds.hpp bounds.hpp

View File

@ -33,11 +33,11 @@ int Bounds::y2() const noexcept {
} }
Point Bounds::pt1() const noexcept { Point Bounds::pt1() const noexcept {
return Point(x, y); return {x, y};
} }
Point Bounds::pt2() const noexcept { Point Bounds::pt2() const noexcept {
return Point(x2(), y2()); return {x2(), y2()};
} }
} }

View File

@ -48,7 +48,7 @@ class Bounds {
}; };
template<typename T> template<typename T>
constexpr ox::Error model(T *io, Bounds *obj) { constexpr ox::Error model(T *io, Bounds *obj) noexcept {
io->template setTypeInfo<Point>(); io->template setTypeInfo<Point>();
oxReturnError(io->field("x", &obj->x)); oxReturnError(io->field("x", &obj->x));
oxReturnError(io->field("y", &obj->y)); oxReturnError(io->field("y", &obj->y));

View File

@ -187,7 +187,7 @@ constexpr bool Point::operator!=(const Point &p) const noexcept {
template<typename T> template<typename T>
constexpr ox::Error model(T *io, Point *obj) { constexpr ox::Error model(T *io, Point *obj) noexcept {
io->template setTypeInfo<Point>(); io->template setTypeInfo<Point>();
oxReturnError(io->field("x", &obj->x)); oxReturnError(io->field("x", &obj->x));
oxReturnError(io->field("y", &obj->y)); oxReturnError(io->field("y", &obj->y));

View File

@ -185,7 +185,7 @@ constexpr bool Size::operator!=(const Size &p) const noexcept {
template<typename T> template<typename T>
constexpr ox::Error model(T *io, Size *obj) { constexpr ox::Error model(T *io, Size *obj) noexcept {
io->template setTypeInfo<Size>(); io->template setTypeInfo<Size>();
oxReturnError(io->field("width", &obj->width)); oxReturnError(io->field("width", &obj->width));
oxReturnError(io->field("height", &obj->height)); oxReturnError(io->field("height", &obj->height));