File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,15 +50,16 @@ namespace sqsgen::io::config {
5050 std::vector<sublattice> const & composition) {
5151 using result_t = parse_result<seed_t >;
5252 auto num_sublattices = sublattice_mode == SUBLATTICE_MODE_INTERACT ? 1 : composition.size ();
53- if (auto seed = get_either_optional<key, std::uint64_t , seed_t >(document); seed.has_value ()) {
53+ if (accessor<Document>::contains (document, key.data )) {
54+ auto seed = get_either<key, std::uint64_t , seed_t >(document);
5455 if (iteration_mode == ITERATION_MODE_SYSTEMATIC)
5556 return parse_error::from_msg<key, CODE_BAD_ARGUMENT>(
5657 " You cannot specify a seed if you have set the iteration mode to \" systematic\" . The "
5758 " seed is only used for random iterations, but in systematic mode there is no "
5859 " randomness involved." );
5960 else
6061 // here we have random mode with a value
61- return seed.value (). template collapse <seed_t >(
62+ return seed.template collapse <seed_t >(
6263 [num_sublattices](std::uint64_t && value) -> result_t {
6364 return seed_t (num_sublattices, std::make_optional (value));
6465 },
Original file line number Diff line number Diff line change @@ -179,6 +179,7 @@ EMSCRIPTEN_BINDINGS(m) {
179179 register_optional<val>();
180180 register_optional<std::string>();
181181 register_optional<std::size_t >();
182+ register_optional<std::uint64_t >();
182183 register_optional<double >();
183184
184185 enum_<sqsgen::Prec>(" Prec" )
You can’t perform that action at this time.
0 commit comments