Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Question] Why are there two adjacent space characters (0x20) in the what() message of ambiguous_local_time? #782

@JMazurkiewicz

Description

@JMazurkiewicz

Repro:

#include <chrono>
#include <date/tz.h>
#include <iostream>

int main() {
  using namespace date;
  using namespace std::chrono_literals;
  try {
    auto zt = zoned_time{"America/New_York",
                         local_days{Sunday[1] / November / 2016} + 1h + 30min};
  } catch (const ambiguous_local_time &e) {
    std::cout << e.what() << '\n';
  }
}

Result:

$ g++ main.cpp -std=c++20 -I../include ../build/libdate-tz.a
$ ./a.out
2016-11-06 01:30:00 is ambiguous.  It could be
2016-11-06 01:30:00 EDT == 2016-11-06 05:30:00 UTC or
2016-11-06 01:30:00 EST == 2016-11-06 06:30:00 UTC

Why are there two space characters between "ambiguous." and "It could"? Is there any reason or is it just a typo?

If it is a typo:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions