Skip to content

Commit 115f12d

Browse files
committed
use nested namespace definitions everywhere, and reformat
1 parent 358f264 commit 115f12d

24 files changed

Lines changed: 52 additions & 99 deletions

examples/headers_namespaces/dog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <iostream>
2-
#include<boost/openmethod.hpp>
2+
#include <boost/openmethod.hpp>
33

44
#include "dog.hpp"
55

@@ -12,4 +12,4 @@ BOOST_OPENMETHOD_DEFINE_OVERRIDER(
1212
os << dog->name << " barks";
1313
}
1414

15-
}
15+
} // namespace canines

examples/headers_namespaces/main_unrelated_namespaces.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ BOOST_OPENMETHOD(
1818
using app_specific_behavior::BOOST_OPENMETHOD_GUIDE(meet);
1919

2020
BOOST_OPENMETHOD_OVERRIDE(
21-
meet, (std::ostream& os, virtual_ptr<Animal>, virtual_ptr<Animal>), void) {
21+
meet, (std::ostream & os, virtual_ptr<Animal>, virtual_ptr<Animal>), void) {
2222
os << "ignore";
2323
}

include/boost/openmethod/compiler.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
#include <boost/assert.hpp>
2626
#include <boost/dynamic_bitset.hpp>
2727

28-
namespace boost {
29-
namespace openmethod {
28+
namespace boost::openmethod {
3029
namespace detail {
3130

3231
template<class Reports, class Facets, typename = void>
@@ -1320,7 +1319,6 @@ auto finalize() -> void {
13201319
Policy::dispatch_data.clear();
13211320
}
13221321

1323-
} // namespace openmethod
1324-
} // namespace boost
1322+
} // namespace boost::openmethod
13251323

13261324
#endif

include/boost/openmethod/core.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,8 @@ class virtual_ptr : public detail::virtual_ptr_impl<Class, Policy> {
741741

742742
if constexpr (
743743
Policy::template has_facet<policies::runtime_checks> &&
744-
Policy::template is_polymorphic<typename impl::traits::virtual_type> &&
744+
Policy::template is_polymorphic<
745+
typename impl::traits::virtual_type> &&
745746
Policy::template is_polymorphic<other_class>) {
746747
// check that dynamic type == static type
747748
auto static_type = Policy::template static_type<other_class>();

include/boost/openmethod/detail/ostdstream.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#include <charconv>
1212
#include <random>
1313

14-
namespace boost {
15-
namespace openmethod {
14+
namespace boost::openmethod {
15+
1616
namespace detail {
1717

1818
// -----------------------------------------------------------------------------
@@ -86,7 +86,7 @@ inline auto operator<<(ostdstream& os, std::size_t value) -> ostdstream& {
8686
}
8787

8888
} // namespace detail
89-
} // namespace openmethod
90-
} // namespace boost
89+
90+
} // namespace boost::openmethod
9191

9292
#endif

include/boost/openmethod/detail/static_list.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <algorithm>
1010
#include <boost/assert.hpp>
1111

12-
namespace boost {
13-
namespace openmethod {
12+
namespace boost::openmethod {
13+
1414
namespace detail {
1515

1616
template<typename T>
@@ -210,6 +210,6 @@ class static_list {
210210
};
211211

212212
} // namespace detail
213-
} // namespace openmethod
214-
} // namespace boost
213+
} // namespace boost::openmethod
214+
215215
#endif

include/boost/openmethod/detail/trace.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
#include <boost/dynamic_bitset.hpp>
1212

13-
namespace boost {
14-
namespace openmethod {
13+
namespace boost::openmethod {
14+
1515
namespace detail {
1616

1717
template<typename Iterator>
@@ -158,7 +158,6 @@ auto operator<<(trace_type<Policy>& trace, const type_name& manip) -> auto& {
158158
}
159159

160160
} // namespace detail
161-
} // namespace openmethod
162-
} // namespace boost
161+
} // namespace boost::openmethod
163162

164163
#endif // BOOST_OPENMETHOD_DETAIL_HPP

include/boost/openmethod/detail/types.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
#include <boost/openmethod/detail/static_list.hpp>
1212

13-
namespace boost {
14-
namespace openmethod {
13+
namespace boost::openmethod {
1514

1615
using type_id = std::uintptr_t;
1716
using vptr_type = const std::uintptr_t*;
@@ -133,7 +132,7 @@ struct overrider_info : static_list<overrider_info>::static_link {
133132
};
134133

135134
} // namespace detail
136-
} // namespace openmethod
137-
} // namespace boost
135+
136+
} // namespace boost::openmethod
138137

139138
#endif

include/boost/openmethod/policies/basic_error_output.hpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
#include <boost/openmethod/policies/basic_policy.hpp>
1010
#include <boost/openmethod/detail/ostdstream.hpp>
1111

12-
namespace boost {
13-
namespace openmethod {
14-
namespace policies {
12+
namespace boost::openmethod::policies {
1513

1614
template<class Policy, typename Stream = detail::ostderr>
1715
struct basic_error_output : virtual error_output {
@@ -21,8 +19,6 @@ struct basic_error_output : virtual error_output {
2119
template<class Policy, typename Stream>
2220
Stream basic_error_output<Policy, Stream>::error_stream;
2321

24-
} // namespace policies
25-
} // namespace openmethod
26-
} // namespace boost
22+
} // namespace boost::openmethod::policies
2723

2824
#endif

include/boost/openmethod/policies/basic_policy.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include <functional>
1515
#include <variant>
1616

17-
namespace boost {
18-
namespace openmethod {
17+
namespace boost::openmethod {
18+
1919
namespace detail {
2020

2121
using class_catalog = detail::static_list<detail::class_info>;
@@ -130,7 +130,6 @@ struct basic_policy : abstract_policy, domain<Policy>, Facets... {
130130

131131
} // namespace policies
132132

133-
} // namespace openmethod
134-
} // namespace boost
133+
} // namespace boost::openmethod
135134

136135
#endif

0 commit comments

Comments
 (0)