Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bac92d08b05f
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4c7258643f78
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 15, 2019

  1. Copy the full SHA
    73f7979 View commit details
  2. Merge pull request #2408 from pleroy/Clang

    Fix SFINAE errors found by Clang
    pleroy authored Dec 15, 2019
    Copy the full SHA
    4c72586 View commit details
Showing with 5 additions and 6 deletions.
  1. +3 −4 geometry/frame.hpp
  2. +2 −2 geometry/frame_body.hpp
7 changes: 3 additions & 4 deletions geometry/frame.hpp
Original file line number Diff line number Diff line change
@@ -57,13 +57,12 @@ struct Frame : not_constructible {
using Tag = FrameTag;
static constexpr Tag tag = tag_;

static constexpr bool is_serializable =
google::protobuf::is_proto_enum<FrameTag>::value;

static void WriteToMessage(not_null<serialization::Frame*> message);

// Checks that the |message| matches the current type.
template<typename = std::enable_if_t<is_serializable>>
template<
typename T = FrameTag,
typename = std::enable_if_t<google::protobuf::is_proto_enum<T>::value>>
static void ReadFromMessage(serialization::Frame const& message);
};

4 changes: 2 additions & 2 deletions geometry/frame_body.hpp
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ template<typename FrameTag, FrameTag tag_,
FrameMotion motion_, Handedness handedness_>
void Frame<FrameTag, tag_, motion_, handedness_>::WriteToMessage(
not_null<serialization::Frame*> const message) {
if constexpr (is_serializable) {
if constexpr (google::protobuf::is_proto_enum<FrameTag>::value) {
std::string const& tag_type_full_name =
google::protobuf::GetEnumDescriptor<Tag>()->full_name();

@@ -40,7 +40,7 @@ void Frame<FrameTag, tag_, motion_, handedness_>::WriteToMessage(

template<typename FrameTag, FrameTag tag_,
FrameMotion motion_, Handedness handedness_>
template<typename>
template<typename T, typename>
void Frame<FrameTag, tag_, motion_, handedness_>::ReadFromMessage(
serialization::Frame const& message) {
std::string const& tag_type_full_name =