Defaults are specified with an additional parameter to make_field_mapper, i.e.
make_field_mapper(&stop_time::pickup_type, 0)
specifies an integer field pickup_type with default value 0. The type of the default value must match the field's property type.
This change uses std::optional (approved for c++17, but still std::experimental::optional in latest clang) to pass values into field_mapper. Passing an empty optional causes the field_mapper to attempt to use a default value.
Defaults for optional fields based on the GTFS specification are added to source.h.
Especially since this is my first timetable PR and first c++ code I've hashed out in awhile, feedback welcome!
Defaults are specified with an additional parameter to
make_field_mapper
, i.e.specifies an integer field
pickup_type
with default value 0. The type of the default value must match the field's property type.This change uses std::optional (approved for c++17, but still std::experimental::optional in latest clang) to pass values into
field_mapper
. Passing an empty optional causes the field_mapper to attempt to use a default value.Defaults for optional fields based on the GTFS specification are added to
source.h
.Especially since this is my first timetable PR and first c++ code I've hashed out in awhile, feedback welcome!