Skip to content

Commit 85dcbac

Browse files
committed
Add indexing operator to state concept and update test output
- Implemented subscript operator for direct access to elements in the state concept. - Updated test output to use a checkmark emoji for passed tests, enhancing readability.
1 parent 770a2ff commit 85dcbac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/unit/test_state_concept.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class ValidState {
3030
std::size_t size() const { return data.size(); }
3131
auto begin() { return data.begin(); }
3232
auto end() { return data.end(); }
33+
34+
// Add indexing operator for compatibility with system_state concept
35+
double& operator[](std::size_t index) { return data[index]; }
36+
const double& operator[](std::size_t index) const { return data[index]; }
3337
};
3438

3539
class InvalidStateNoValueType {
@@ -198,7 +202,7 @@ int main() {
198202

199203
std::cout << "\n=== Test Results ===" << std::endl;
200204
if (all_passed) {
201-
std::cout << "🎉 All tests PASSED!" << std::endl;
205+
std::cout << " All tests PASSED!" << std::endl;
202206
return 0;
203207
} else {
204208
std::cout << "❌ Some tests FAILED!" << std::endl;

0 commit comments

Comments
 (0)