// Check that the number of constructor arguments matches the array size. if (type.fields().size() != SkToSizeT(args.size())) {
context.fErrors->error(pos,
String::printf("invalid arguments to '%s' constructor " "(expected %zu elements, but found %d)",
type.displayName().c_str(), type.fields().size(),
args.size())); return nullptr;
}
// A struct with atomic members cannot be constructed. if (type.isOrContainsAtomic()) {
context.fErrors->error(
pos,
String::printf("construction of struct type '%s' with atomic member is not allowed",
type.displayName().c_str())); return nullptr;
}
// Convert each constructor argument to the struct's field type. for (int index=0; index<args.size(); ++index) {
std::unique_ptr<Expression>& argument = args[index]; const Field& field = type.fields()[index];
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.