Skip to content

No matching constructor for initialization of 'TimestampT' (aka 'time_point<std::chrono::high_resolution_clock>') #15

@crucialfelix

Description

@crucialfelix

Compile failure on OS X (with our weird clocks)

Same as #6 which was closed I think prematurely.

He said that this fixes it PR #5 #5

bobsomers@4026735

Wonderful library, just what I needed ! Thanks

OS X 10.10.5
clang --version
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
build ❯ cmake ..
-- Boost version: 1.56.0
-- Found the following Boost libraries:
--   coroutine
--   context
--   system
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/crucial/Downloads/cpp.react/build
build ❯ make
[  7%] Building CXX object CMakeFiles/CppReact.dir/src/engine/PulsecountEngine.cpp.o
[ 15%] Building CXX object CMakeFiles/CppReact.dir/src/engine/SubtreeEngine.cpp.o
[ 23%] Building CXX object CMakeFiles/CppReact.dir/src/engine/ToposortEngine.cpp.o
[ 30%] Building CXX object CMakeFiles/CppReact.dir/src/logging/EventLog.cpp.o
/Users/crucial/Downloads/cpp.react/src/logging/EventLog.cpp:18:5: error: no matching constructor for initialization of 'TimestampT'
      (aka 'time_point<std::chrono::high_resolution_clock>')
    time_{ std::chrono::system_clock::now() },
    ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit copy constructor)
      not viable: no known conversion from 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' to 'const
      time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' for 1st argument
class _LIBCPP_TYPE_VIS_ONLY time_point
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit move constructor)
      not viable: no known conversion from 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' to
      'time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' for 1st argument
class _LIBCPP_TYPE_VIS_ONLY time_point
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:764:70: note: candidate constructor not viable: no known conversion
      from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const duration' (aka 'const std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> >')
      for 1st argument
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : __d_(__d) {}
                                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:769:5: note: candidate template ignored: could not match
      'std::__1::chrono::steady_clock' against 'std::__1::chrono::system_clock'
    time_point(const time_point<clock, _Duration2>& t,
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:763:61: note: candidate constructor not viable: requires 0
      arguments, but 1 was provided
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
                                                            ^
/Users/crucial/Downloads/cpp.react/src/logging/EventLog.cpp:30:5: error: no matching constructor for initialization of 'TimestampT'
      (aka 'time_point<std::chrono::high_resolution_clock>')
    time_{ std::chrono::system_clock::now() },
    ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit copy constructor)
      not viable: no known conversion from 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' to 'const
      time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' for 1st argument
class _LIBCPP_TYPE_VIS_ONLY time_point
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit move constructor)
      not viable: no known conversion from 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' to
      'time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' for 1st argument
class _LIBCPP_TYPE_VIS_ONLY time_point
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:764:70: note: candidate constructor not viable: no known conversion
      from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const duration' (aka 'const std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> >')
      for 1st argument
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : __d_(__d) {}
                                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:769:5: note: candidate template ignored: could not match
      'std::__1::chrono::steady_clock' against 'std::__1::chrono::system_clock'
    time_point(const time_point<clock, _Duration2>& t,
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:763:61: note: candidate constructor not viable: requires 0
      arguments, but 1 was provided
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
                                                            ^
/Users/crucial/Downloads/cpp.react/src/logging/EventLog.cpp:57:5: error: no matching constructor for initialization of 'TimestampT'
      (aka 'time_point<std::chrono::high_resolution_clock>')
    startTime_(std::chrono::system_clock::now())
    ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit copy constructor)
      not viable: no known conversion from 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' to 'const
      time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' for 1st argument
class _LIBCPP_TYPE_VIS_ONLY time_point
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit move constructor)
      not viable: no known conversion from 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' to
      'time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' for 1st argument
class _LIBCPP_TYPE_VIS_ONLY time_point
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:764:70: note: candidate constructor not viable: no known conversion
      from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const duration' (aka 'const std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> >')
      for 1st argument
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : __d_(__d) {}
                                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:769:5: note: candidate template ignored: could not match
      'std::__1::chrono::steady_clock' against 'std::__1::chrono::system_clock'
    time_point(const time_point<clock, _Duration2>& t,
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:763:61: note: candidate constructor not viable: requires 0
      arguments, but 1 was provided
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
                                                            ^
3 errors generated.
make[2]: *** [CMakeFiles/CppReact.dir/src/logging/EventLog.cpp.o] Error 1
make[1]: *** [CMakeFiles/CppReact.dir/all] Error 2
make: *** [all] Error 2

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