+#include <msp/core/algorithm.h>
#include <msp/gl/resources.h>
#include <msp/io/seekable.h>
#include "builtin.h"
namespace GL {
namespace SL {
-void add_builtin_type(Stage &stage, const std::string &name, BasicTypeDeclaration::Kind kind, unsigned size, unsigned sign)
+void add_builtin_type(Stage &stage, const string &name, BasicTypeDeclaration::Kind kind, unsigned size, unsigned sign)
{
RefPtr<BasicTypeDeclaration> type = new BasicTypeDeclaration;
type->source = BUILTIN_SOURCE;
if(type==Stage::SHARED)
return &module->shared;
- for(list<Stage>::iterator i=module->stages.begin(); i!=module->stages.end(); ++i)
- if(i->type==type)
- return &*i;
- return 0;
+ auto i = find_member(module->stages, type, &Stage::type);
+ return (i!=module->stages.end() ? &*i : 0);
}
} // namespace SL