Skip to content

Commit 03e5d93

Browse files
committed
Move concept to separate header.
1 parent f849f1f commit 03e5d93

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

nyan/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ add_library(nyan SHARED
3030
basic_type.cpp
3131
c3.cpp
3232
change_tracker.cpp
33+
concept.cpp
3334
config.cpp
3435
curve.cpp
3536
database.cpp

nyan/concept.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright 2025-2025 the nyan authors, LGPLv3+. See copying.md for legal info.
2+
3+
#include "concept.h"
4+
5+
6+
namespace nyan {
7+
8+
// this file is intentionally empty
9+
10+
}

nyan/concept.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2025-2025 the nyan authors, LGPLv3+. See copying.md for legal info.
2+
3+
#pragma once
4+
5+
#include <concepts>
6+
7+
#include "nyan/value/value.h"
8+
9+
10+
namespace nyan {
11+
12+
/**
13+
* Type that is either a nyan value or object.
14+
* Object is not a value (ObjectValue is), but want to allow an
15+
* overloaded conversion for direct object access.
16+
*/
17+
template <typename T>
18+
concept ValueLike = std::derived_from<T, Value> || std::is_same_v<T, Object>;
19+
20+
} // namespace nyan

nyan/object.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#pragma once
33

44

5-
#include <concepts>
65
#include <deque>
76
#include <memory>
87
#include <sstream>
@@ -11,6 +10,7 @@
1110
#include <vector>
1211

1312
#include "api_error.h"
13+
#include "concept.h"
1414
#include "config.h"
1515
#include "object_notifier_types.h"
1616
#include "util.h"
@@ -31,15 +31,6 @@ class Value;
3131
class View;
3232

3333

34-
/**
35-
* Type that is either a nyan value or object.
36-
* Object is not a value (ObjectValue is), but want to allow an
37-
* overloaded conversion for direct object access.
38-
*/
39-
template <typename T>
40-
concept ValueLike = std::derived_from<T, Value> || std::is_same_v<T, Object>;
41-
42-
4334
/**
4435
* Handle for accessing a nyan object independent of time.
4536
*/

0 commit comments

Comments
 (0)