Skip to content
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
5 changes: 5 additions & 0 deletions example/router/detail/router.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class router_base

virtual ~router_base();

router_base(router_base const&) = delete;
router_base& operator=(router_base const&) = delete;
router_base(router_base&&) noexcept = default;
router_base& operator=(router_base&&) noexcept = default;

void
insert_impl(
core::string_view s,
Expand Down
6 changes: 5 additions & 1 deletion example/router/router.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ class router
/// Constructor
router() = default;

router(router const&) = delete;
router& operator=(router const&) = delete;
router(router&&) noexcept = default;
router& operator=(router&&) noexcept = default;

/** Route the specified URL path to a resource

@param path A url path with dynamic segments
Expand Down Expand Up @@ -88,4 +93,3 @@ class router
#include "impl/router.hpp"

#endif

11 changes: 11 additions & 0 deletions test/unit/example/router/router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,20 @@

#include "test_suite.hpp"

#include <type_traits>

namespace boost {
namespace urls {

static_assert(!std::is_copy_constructible<router<int>>::value,
"router should be move-only");
static_assert(!std::is_copy_assignable<router<int>>::value,
"router should be move-only");
static_assert(std::is_move_constructible<router<int>>::value,
"router should support moves");
static_assert(std::is_move_assignable<router<int>>::value,
"router should support moves");

struct router_test
{
static
Expand Down
Loading