Skip to content

Commit

Permalink
Remove BOOST_BUFFERS_DOCS macro
Browse files Browse the repository at this point in the history
  • Loading branch information
ashtum committed Apr 12, 2024
1 parent d95319d commit efdde71
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 188 deletions.
3 changes: 0 additions & 3 deletions doc/mrdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ verbose: true
multipage: true

cmake: '-D BUILD_TESTING=ON'

defines:
- BOOST_BUFFERS_DOCS
73 changes: 18 additions & 55 deletions include/boost/buffers/algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,59 +21,6 @@
namespace boost {
namespace buffers {

#ifdef BOOST_BUFFERS_DOCS

/** Returns the type of a prefix of a buffer sequence.
*/
template<class BufferSequence>
using prefix_type = __see_below__;

/** Returns the type of a suffix of a buffer sequence.
*/
template<class BufferSequence>
using suffix_type = __see_below__;

/** Return a prefix of the buffer sequence.
*/
template<class BufferSequence>
prefix_type<BufferSequence>
prefix(
BufferSequence const& b,
std::size_t n);

/** Return a prefix of the buffer sequence.
*/
template<class BufferSequence>
prefix_type<BufferSequence>
sans_suffix(
BufferSequence const& b,
std::size_t n);

/** Return a suffix of the buffer sequence.
*/
template<class BufferSequence>
suffix_type<BufferSequence>
suffix(
BufferSequence const& b,
std::size_t n);

/** Return a suffix of the buffer sequence.
*/
template<class BufferSequence>
suffix_type<BufferSequence>
sans_prefix(
BufferSequence const& b,
std::size_t n);

/** Return the first buffer in a sequence.
*/
template<class BufferSequence>
__see_below__
front(
BufferSequence const& b);

#else

template<class BufferSequence>
void
tag_invoke(
Expand All @@ -88,13 +35,17 @@ tag_invoke(
BufferSequence const&,
std::size_t) = delete;

/** Returns the type of a prefix of a buffer sequence.
*/
template<class BufferSequence>
using prefix_type = decltype(
tag_invoke(
prefix_tag{},
std::declval<BufferSequence const&>(),
std::size_t{}));

/** Returns the type of a suffix of a buffer sequence.
*/
template<class BufferSequence>
using suffix_type = decltype(
tag_invoke(
Expand Down Expand Up @@ -221,13 +172,25 @@ struct front_impl

} // detail

/** Return a prefix of the buffer sequence.
*/
constexpr detail::prefix_impl prefix{};

/** Return a suffix of the buffer sequence.
*/
constexpr detail::suffix_impl suffix{};

/** Return a suffix of the buffer sequence.
*/
constexpr detail::sans_prefix_impl sans_prefix{};

/** Return a prefix of the buffer sequence.
*/
constexpr detail::sans_suffix_impl sans_suffix{};
constexpr detail::front_impl front{};

#endif
/** Return the first buffer in a sequence.
*/
constexpr detail::front_impl front{};

} // buffers
} // boost
Expand Down
2 changes: 0 additions & 2 deletions include/boost/buffers/any_dynamic_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,10 @@ class any_dynamic_buffer_impl

template<
class DynamicBuffer
#ifndef BOOST_BUFFERS_DOCS
, class = typename std::enable_if<
is_dynamic_buffer<
typename std::decay<DynamicBuffer>::type
>::value>::type
#endif
>
auto
make_any(DynamicBuffer&& b) ->
Expand Down
21 changes: 2 additions & 19 deletions include/boost/buffers/buffer_copy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,6 @@

namespace boost {
namespace buffers {

#ifdef BOOST_BUFFERS_DOCS

/** Copy buffer contents
*/
template<
class MutableBufferSequence,
class ConstBufferSequence>
std::size_t
buffer_copy(
MutableBufferSequence const& to,
ConstBufferSequence const& from,
std::size_t at_most =
std::size_t(-1)) noexcept;

#else

namespace detail {

struct buffer_copy_impl
Expand Down Expand Up @@ -119,10 +102,10 @@ struct buffer_copy_impl

} // detail

/** Copy buffer contents
*/
constexpr detail::buffer_copy_impl buffer_copy{};

#endif

} // buffers
} // boost

Expand Down
26 changes: 7 additions & 19 deletions include/boost/buffers/buffer_size.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,6 @@
namespace boost {
namespace buffers {

#ifdef BOOST_BUFFERS_DOCS

/** Return the total octets in a buffer sequence
@par Constraints
@code
is_const_buffer_sequence< ConstBufferSequence >::value == true
@endcode
*/
template<
class ConstBufferSequence>
std::size_t
buffer_size(
ConstBufferSequence const& b) noexcept;

#else

template<class Buffers>
std::size_t
tag_invoke(
Expand Down Expand Up @@ -70,9 +53,14 @@ struct buffer_size_impl

} // detail

constexpr detail::buffer_size_impl buffer_size{};
/** Return the total octets in a buffer sequence
#endif
@par Constraints
@code
is_const_buffer_sequence< ConstBufferSequence >::value == true
@endcode
*/
constexpr detail::buffer_size_impl buffer_size{};

} // buffers
} // boost
Expand Down
4 changes: 0 additions & 4 deletions include/boost/buffers/const_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class const_buffer
const_buffer& operator=(
const_buffer const&) = default;

#ifndef BOOST_BUFFERS_DOCS
// conversion to boost::asio::const_buffer
template<
class T
Expand All @@ -74,7 +73,6 @@ class const_buffer
{
return T{ data(), size() };
}
#endif

void const*
data() const noexcept
Expand Down Expand Up @@ -126,7 +124,6 @@ class const_buffer
return b += n;
}

#ifndef BOOST_BUFFERS_DOCS
friend
const_buffer
tag_invoke(
Expand All @@ -151,7 +148,6 @@ class const_buffer
return { b.p_ + (n0 - n), n };
return b;
}
#endif
};

} // buffers
Expand Down
2 changes: 0 additions & 2 deletions include/boost/buffers/const_buffer_pair.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class const_buffer_pair
return b_ + 2;
}

#ifndef BOOST_BUFFERS_DOCS
friend
const_buffer_pair
tag_invoke(
Expand All @@ -114,7 +113,6 @@ class const_buffer_pair
{
return b.suffix_impl(n);
}
#endif

private:
BOOST_BUFFERS_DECL
Expand Down
4 changes: 0 additions & 4 deletions include/boost/buffers/const_buffer_span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class const_buffer_span
*/
template<
class ConstBufferSequence
#ifndef BOOST_BUFFERS_DOCS
, class = typename std::enable_if<
! std::is_same<
ConstBufferSequence,
Expand All @@ -69,7 +68,6 @@ class const_buffer_span
const&>().begin()),
const_buffer const*>::value
>::type
#endif
>
explicit
const_buffer_span(
Expand Down Expand Up @@ -105,7 +103,6 @@ class const_buffer_span
return p_ + n_;
}

#ifndef BOOST_BUFFERS_DOCS
friend
const_buffer_subspan
tag_invoke(
Expand All @@ -125,7 +122,6 @@ class const_buffer_span
{
return s.suffix_impl(n);
}
#endif

private:
inline
Expand Down
4 changes: 0 additions & 4 deletions include/boost/buffers/const_buffer_subspan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
namespace boost {
namespace buffers {

#ifndef BOOST_BUFFERS_DOCS
class const_buffer_span;
#endif

/** Holds a span of buffers that cannot be modified.
Expand Down Expand Up @@ -90,7 +88,6 @@ class const_buffer_subspan
const_iterator
end() const noexcept;

#ifndef BOOST_BUFFERS_DOCS
friend
const_buffer_subspan
tag_invoke(
Expand All @@ -110,7 +107,6 @@ class const_buffer_subspan
{
return s.suffix_impl(n);
}
#endif

private:
BOOST_BUFFERS_DECL
Expand Down
8 changes: 1 addition & 7 deletions include/boost/buffers/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ namespace buffers {

//------------------------------------------------

#if defined(BOOST_BUFFERS_DOCS)
# define BOOST_BUFFERS_DECL
#else
# if (defined(BOOST_BUFFERS_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_BUFFERS_STATIC_LINK)
# if defined(BOOST_BUFFERS_SOURCE)
# define BOOST_BUFFERS_DECL BOOST_SYMBOL_EXPORT
Expand All @@ -40,13 +37,10 @@ namespace buffers {
# endif
# include <boost/config/auto_link.hpp>
# endif
#endif

//------------------------------------------------

#if ! defined(BOOST_BUFFERS_DOCS) && ( \
defined(BOOST_NO_CXX14_AGGREGATE_NSDMI) || \
defined(BOOST_MSVC) )
#if defined(BOOST_NO_CXX14_AGGREGATE_NSDMI) || defined(BOOST_MSVC)
# define BOOST_BUFFERS_AGGREGATE_WORKAROUND
#endif

Expand Down
4 changes: 0 additions & 4 deletions include/boost/buffers/make_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ make_buffer(
*/
template<
class T, std::size_t N
#ifndef BOOST_BUFFERS_DOCS
, class = typename std::enable_if<
std::is_trivially_copyable<T>::value>::type
#endif
>
mutable_buffer
make_buffer(
Expand All @@ -82,10 +80,8 @@ make_buffer(
*/
template<
class T, std::size_t N
#ifndef BOOST_BUFFERS_DOCS
, class = typename std::enable_if<
std::is_trivially_copyable<T>::value>::type
#endif
>
const_buffer
make_buffer(
Expand Down
4 changes: 0 additions & 4 deletions include/boost/buffers/mutable_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class mutable_buffer
mutable_buffer& operator=(
mutable_buffer const&) = default;

#ifndef BOOST_BUFFERS_DOCS
// conversion to boost::asio::mutable_buffer
template<
class T
Expand All @@ -70,7 +69,6 @@ class mutable_buffer
{
return T{ data(), size() };
}
#endif

void*
data() const noexcept
Expand Down Expand Up @@ -134,7 +132,6 @@ class mutable_buffer
return b += n;
}

#ifndef BOOST_BUFFERS_DOCS
friend
mutable_buffer
tag_invoke(
Expand All @@ -158,7 +155,6 @@ class mutable_buffer
return { b.p_ + b.n_ - n, n };
return b;
}
#endif
};

} // buffers
Expand Down
Loading

0 comments on commit efdde71

Please sign in to comment.