Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UB due is_trivially_default_constructible specializations #284

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions include/boost/gil/packed_pixel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,4 @@ struct iterator_is_mutable<const packed_pixel<P, C, L>*> : std::false_type {};

}} // namespace boost::gil

namespace std
{

// TODO: Avoid polluting std namespace?
template <typename P, typename C, typename L>
struct is_trivially_default_constructible<boost::gil::packed_pixel<P, C, L>>
: std::is_trivially_default_constructible<P>
{};

} // namespace std

#endif
12 changes: 1 addition & 11 deletions include/boost/gil/pixel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ struct pixel :
}

auto operator[](std::size_t index) const
-> typename channel_traits<channel_t>::const_reference
-> typename channel_traits<channel_t>::const_reference
{
return dynamic_at_c(*this, index);
}
Expand Down Expand Up @@ -298,14 +298,4 @@ struct channel_type<pixel<ChannelValue, Layout>>

}} // namespace boost::gil

namespace std {

// TODO: Avoid polluting std namespace
template <typename ChannelValue, typename Layout>
struct is_trivially_default_constructible<boost::gil::pixel<ChannelValue, Layout>>
: ::std::is_trivially_default_constructible<ChannelValue>
{};

} // namespace std

#endif