@@ -531,6 +531,37 @@ TEST(SingleComponentView, Storage) {
531531 ASSERT_EQ (cview.storage <const char >(), nullptr );
532532}
533533
534+ TEST (SingleComponentView, ArrowOperator) {
535+ entt::registry registry;
536+ const auto entity = registry.create ();
537+ auto view = registry.view <int >();
538+ auto cview = registry.view <const char >();
539+
540+ testing::StaticAssertTypeEq<decltype (view.operator ->()), entt::storage_type_t <int > *>();
541+ testing::StaticAssertTypeEq<decltype (cview.operator ->()), const entt::storage_type_t <char > *>();
542+
543+ ASSERT_TRUE (view);
544+ ASSERT_TRUE (cview);
545+
546+ ASSERT_NE (view.operator ->(), nullptr );
547+ ASSERT_NE (cview.operator ->(), nullptr );
548+
549+ view->emplace (entity);
550+ registry.emplace <char >(entity);
551+
552+ ASSERT_EQ (view.operator ->(), ®istry.storage <int >());
553+ ASSERT_EQ (cview.operator ->(), ®istry.storage <char >());
554+
555+ ASSERT_EQ (view.operator ->(), view.storage ());
556+ ASSERT_EQ (cview.operator ->(), cview.storage ());
557+
558+ view = {};
559+ cview = {};
560+
561+ ASSERT_EQ (view.operator ->(), nullptr );
562+ ASSERT_EQ (cview.operator ->(), nullptr );
563+ }
564+
534565TEST (SingleComponentView, SwapStorage) {
535566 using namespace entt ::literals;
536567
0 commit comments