Skip to content

Commit a868f9a

Browse files
committed
fable: Forward-declare make_prototype<> in interface.hpp
1 parent cea763a commit a868f9a

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

fable/include/fable/schema/confable.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ namespace fable {
3636

3737
// Forward declarations:
3838
class Confable;
39-
class Schema;
4039

4140
namespace schema {
4241

fable/include/fable/schema/interface.hpp

+12
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
#include <fable/json.hpp> // for Json
3535

3636
namespace fable {
37+
38+
// Forward declarations:
39+
class Confable;
40+
3741
namespace schema {
3842

3943
/**
@@ -349,6 +353,14 @@ class Base : public Interface {
349353
std::string desc_{};
350354
};
351355

356+
// ------------------------------------------------------------------------- //
357+
358+
template <typename T, std::enable_if_t<std::is_base_of<Confable, T>::value, int> = 0>
359+
auto make_prototype(std::string&& desc = "");
360+
361+
template <typename T, std::enable_if_t<!std::is_base_of<Confable, T>::value, int> = 0>
362+
auto make_prototype(std::string&& desc = "");
363+
352364
} // namespace schema
353365
} // namespace fable
354366

fable/include/fable/schema/magic.hpp

-6
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ class Confable;
5555

5656
namespace schema {
5757

58-
template <typename T, std::enable_if_t<std::is_base_of<Confable, T>::value, int> = 0>
59-
auto make_prototype(std::string&& desc = "");
60-
61-
template <typename T, std::enable_if_t<!std::is_base_of<Confable, T>::value, int> = 0>
62-
auto make_prototype(std::string&& desc = "");
63-
6458
template <typename T, typename P>
6559
Array<T, P>::Array(std::vector<T>* ptr, std::string&& desc)
6660
: Array<T, P>(ptr, make_prototype<T>(), std::move(desc)) {}

0 commit comments

Comments
 (0)