Skip to content

Commit b8b8f79

Browse files
committed
Invert the naming of BoxFn to FnBox
1 parent ab6fe0e commit b8b8f79

File tree

14 files changed

+364
-364
lines changed

14 files changed

+364
-364
lines changed

subdoc/lib/database.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ struct Database {
462462
sus::Vec<Comment*> to_resolve;
463463
{
464464
sus::Vec<Comment*>* to_resolve_ptr = &to_resolve;
465-
sus::fn::BoxFnMut<void(Comment&)> fn = sus_bind_mut(
465+
sus::fn::FnMutBox<void(Comment&)> fn = sus_bind_mut(
466466
sus_store(sus_unsafe_pointer(to_resolve_ptr)), [&](Comment& c) {
467467
if (c.attrs.inherit.is_some()) {
468468
to_resolve_ptr->push(&c);

subdoc/lib/run_options.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct RunOptions {
3838
exclude_path_patterns = sus::move(r);
3939
return sus::move(*this);
4040
}
41-
RunOptions set_on_tu_complete(sus::fn::BoxFn<void(clang::ASTContext&)> fn) && {
41+
RunOptions set_on_tu_complete(sus::fn::FnBox<void(clang::ASTContext&)> fn) && {
4242
on_tu_complete = sus::some(sus::move(fn));
4343
return sus::move(*this);
4444
}
@@ -53,7 +53,7 @@ struct RunOptions {
5353
///
5454
/// Used for tests to observe the AST and test subdoc methods that act on
5555
/// things from the AST.
56-
sus::Option<sus::fn::BoxFn<void(clang::ASTContext&)>> on_tu_complete;
56+
sus::Option<sus::fn::FnBox<void(clang::ASTContext&)>> on_tu_complete;
5757
};
5858

5959
} // namespace subdoc

subspace/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ target_sources(subspace PUBLIC
4545
"containers/array.h"
4646
"containers/slice.h"
4747
"containers/vec.h"
48-
"fn/__private/box_fn_storage.h"
48+
"fn/__private/fn_box_storage.h"
4949
"fn/callable.h"
5050
"fn/fn.h"
5151
"fn/bind.h"
52-
"fn/box_fn_defn.h"
53-
"fn/box_fn_impl.h"
52+
"fn/fn_box_defn.h"
53+
"fn/fn_box_impl.h"
5454
"fn/fn_defn.h"
5555
"iter/__private/into_iterator_archetype.h"
5656
"iter/__private/iterator_end.h"
@@ -152,7 +152,7 @@ add_executable(subspace_unittests
152152
"construct/from_unittest.cc"
153153
"construct/into_unittest.cc"
154154
"construct/default_unittest.cc"
155-
"fn/box_fn_unittest.cc"
155+
"fn/fn_box_unittest.cc"
156156
"fn/fn_unittest.cc"
157157
"iter/iterator_unittest.cc"
158158
"mem/addressof_unittest.cc"

subspace/containers/array.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "subspace/containers/__private/slice_iter.h"
2828
#include "subspace/containers/slice.h"
2929
#include "subspace/fn/callable.h"
30-
#include "subspace/fn/box_fn_defn.h"
30+
#include "subspace/fn/fn_box_defn.h"
3131
#include "subspace/macros/compiler.h"
3232
#include "subspace/marker/unsafe.h"
3333
#include "subspace/mem/clone.h"

subspace/fn/__private/box_fn_storage.h renamed to subspace/fn/__private/fn_box_storage.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,40 @@
1818

1919
namespace sus::fn::__private {
2020

21-
struct BoxFnStorageVtableBase {};
21+
struct FnBoxStorageVtableBase {};
2222

23-
struct BoxFnStorageBase {
23+
struct FnBoxStorageBase {
2424
// Should be to a static lifetime pointee.
25-
Option<const BoxFnStorageVtableBase&> vtable = Option<const BoxFnStorageVtableBase&>::none();
25+
Option<const FnBoxStorageVtableBase&> vtable = Option<const FnBoxStorageVtableBase&>::none();
2626
};
2727

2828
template <class R, class... CallArgs>
29-
struct BoxFnStorageVtable final : public BoxFnStorageVtableBase {
30-
R (*call_once)(__private::BoxFnStorageBase&&, CallArgs...);
31-
R (*call_mut)(__private::BoxFnStorageBase&, CallArgs...);
32-
R (*call)(const __private::BoxFnStorageBase&, CallArgs...);
29+
struct FnBoxStorageVtable final : public FnBoxStorageVtableBase {
30+
R (*call_once)(__private::FnBoxStorageBase&&, CallArgs...);
31+
R (*call_mut)(__private::FnBoxStorageBase&, CallArgs...);
32+
R (*call)(const __private::FnBoxStorageBase&, CallArgs...);
3333
};
3434

3535
template <class F>
36-
class BoxFnStorage final : public BoxFnStorageBase {
36+
class FnBoxStorage final : public FnBoxStorageBase {
3737
public:
38-
constexpr BoxFnStorage(F&& callable) : callable_(::sus::move(callable)) {}
38+
constexpr FnBoxStorage(F&& callable) : callable_(::sus::move(callable)) {}
3939

4040
template <class R, class... CallArgs>
41-
static R call(const BoxFnStorageBase& self_base, CallArgs... callargs) {
42-
const auto& self = static_cast<const BoxFnStorage&>(self_base);
41+
static R call(const FnBoxStorageBase& self_base, CallArgs... callargs) {
42+
const auto& self = static_cast<const FnBoxStorage&>(self_base);
4343
return self.callable_(forward<CallArgs>(callargs)...);
4444
}
4545

4646
template <class R, class... CallArgs>
47-
static R call_mut(BoxFnStorageBase& self_base, CallArgs... callargs) {
48-
auto& self = static_cast<BoxFnStorage&>(self_base);
47+
static R call_mut(FnBoxStorageBase& self_base, CallArgs... callargs) {
48+
auto& self = static_cast<FnBoxStorage&>(self_base);
4949
return self.callable_(forward<CallArgs>(callargs)...);
5050
}
5151

5252
template <class R, class... CallArgs>
53-
static R call_once(BoxFnStorageBase&& self_base, CallArgs... callargs) {
54-
auto&& self = static_cast<BoxFnStorage&&>(self_base);
53+
static R call_once(FnBoxStorageBase&& self_base, CallArgs... callargs) {
54+
auto&& self = static_cast<FnBoxStorage&&>(self_base);
5555
return ::sus::move(self.callable_)(forward<CallArgs>(callargs)...);
5656
}
5757

subspace/fn/bind.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <type_traits>
1818

1919
#include "subspace/fn/callable.h"
20-
#include "subspace/fn/box_fn_defn.h"
20+
#include "subspace/fn/fn_box_defn.h"
2121
#include "subspace/macros/__private/compiler_bugs.h"
2222
#include "subspace/macros/eval_macro.h"
2323
#include "subspace/macros/for_each.h"

subspace/fn/fn.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
#pragma once
1616

1717
#include "subspace/fn/bind.h"
18-
#include "subspace/fn/box_fn_defn.h"
19-
#include "subspace/fn/box_fn_impl.h"
18+
#include "subspace/fn/fn_box_defn.h"
19+
#include "subspace/fn/fn_box_impl.h"
2020
#include "subspace/fn/fn_defn.h"

0 commit comments

Comments
 (0)