jsego / bfgp-pp

A framework based on Best-First Generalized Planning where solutions are either assembly-like programs, or structured programs that are syntactically terminating.
GNU General Public License v3.0
3 stars 3 forks source link

Change `high_resolution_clock` with `system_clock` to allow compilation in macOS #20

Closed Alejandro-FA closed 1 year ago

Alejandro-FA commented 1 year ago

The reason behind is that std::chrono::high_resolution_clock is an alias of std::chrono::system_clock or std::chrono::steady_clock, or a third, independent clock (see https://en.cppreference.com/w/cpp/chrono/high_resolution_clock).

In my macOS laptop, it seems that high_resolution_clock is an alias of steady_clock instead of system_clock. Therefore, the conversion from high_resolution_clock to system_clock is not allowed.

One alternative to the one proposed in the PR might be to change get_time() as follows:

    std::chrono::time_point<std::chrono::high_resolution_clock> get_time(){
        return std::chrono::high_resolution_clock::now();
    }

But this would imply multiple changes in other source files, and I don't know which one is the preferred approach.