Fixed the following issues in XCEngine Core module documentation: - Added 'using namespace XCEngine::Core;' to all code examples that use Core types (Event, FileWriter, etc.) without full namespace qualification - Added missing '#include <XCEngine/Containers/String.h>' to FileWriter examples that use Containers::String - Added '#include <string>' to Flush.md example using std::to_string Affected files: - core/core.md: Added using directive and Containers include - event/*.md: Added using namespace to all 8 event doc files - filewriter/*.md: Added using namespace and proper includes to all 6 files
656 B
656 B
Event::end
Iterator end();
获取结束迭代器。
描述
返回订阅列表的结束迭代器,用于范围for循环遍历所有订阅的回调。
返回: Iterator - 指向末尾的迭代器(等价于 std::vector<Listener>::iterator)
复杂度: O(1)
示例:
#include <XCEngine/Core/Event.h>
using namespace XCEngine::Core;
Event<int> event;
event.Subscribe([](int v) { printf("Callback: %d\n", v); });
// 遍历所有订阅
for (auto& [id, callback] : event) {
callback(42);
}