Skip to content

Commit

Permalink
Everything compiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
pleroy committed Feb 25, 2023
1 parent 33c0137 commit 87ba4d0
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 12 deletions.
6 changes: 4 additions & 2 deletions base/not_null.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ template<typename Pointer>
not_null<Pointer> check_not_null(not_null<Pointer> pointer);
#endif

template<typename T, typename... Args>
not_null<std::shared_ptr<T>> make_not_null_shared(Args&&... args);

// Factory for a |not_null<std::unique_ptr<T>>|, forwards the arguments to the
// constructor of T. |make_not_null_unique<T>(args)| is interchangeable with
// |check_not_null(make_unique<T>(args))|, but does not perform a |CHECK|, since
Expand All @@ -364,10 +367,9 @@ not_null<Result> dynamic_cast_not_null(not_null<std::unique_ptr<T>>&& pointer);

using internal::check_not_null;
using internal::dynamic_cast_not_null;
using internal::make_not_null_shared;
using internal::make_not_null_unique;
using internal::not_null;
using internal::NotNullStorage;
using internal::operator<<;
using internal::remove_not_null;

} // namespace _not_null
Expand Down
2 changes: 1 addition & 1 deletion base/status_utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ absl::Status const& GetStatus(absl::StatusOr<T> const& s) {
do { \
/* Using _status below to avoid capture problems if expr is "status". */ \
::absl::Status const _status = \
(::principia::base::internal_status_utilities::GetStatus(expr)); \
(::principia::base::_status_utilities::internal::GetStatus(expr)); \
if (!_status.ok()) \
return _status; \
} while (false)
Expand Down
2 changes: 2 additions & 0 deletions base/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ extern char const Version[];

} // namespace internal

using internal::BuildDate;
using internal::Version;

} // namespace _version
} // namespace base
Expand Down
6 changes: 5 additions & 1 deletion generate_version_translation_unit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ $versionheadertext = [string]::format(
"`n" +
"namespace principia {{`n" +
"namespace base {{`n" +
"namespace _version {{`n" +
"namespace internal {{`n" +
"`n" +
"char const BuildDate[] = `"{0:yyyy'-'MM'-'dd'T'HH':'mm':'ssK}`";`n" +
"char const BuildDate[] = `"{0:yyyy'-'MM'-'dd'T'HH':'mm':'ssK}`";`n" +
"char const Version[] =`n" +
" u8`"{1}`";`n" +
"`n" +
"}} // namespace internal`n" +
"}} // namespace _version`n" +
"}} // namespace base`n" +
"}} // namespace principia`n",
$newdate.ToUniversalTime(),
Expand Down
4 changes: 2 additions & 2 deletions geometry/pair.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace internal_pair {
using quantities::Difference;
using quantities::Product;
using quantities::Quotient;
using namespace principia::base::_not_constructible;
using namespace principia::base::_not_null;

template<typename T1, typename T2>
class Pair;
Expand Down Expand Up @@ -209,8 +211,6 @@ using internal_pair::vector_of;
namespace internal_barycentre_calculator {

using quantities::Difference;
using namespace principia::base::_not_constructible;
using namespace principia::base::_not_null;

template<typename T1, typename T2, typename Weight>
class BarycentreCalculator<Pair<T1, T2>, Weight> final {
Expand Down
5 changes: 3 additions & 2 deletions journal/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace principia {
using base::HexadecimalEncoder;
using namespace principia::base::_array;
using namespace principia::base::_serialization;
using namespace principia::base::_version;

namespace journal {

Expand Down Expand Up @@ -45,8 +46,8 @@ void Recorder::Activate(base::not_null<Recorder*> const recorder) {
active_recorder_->WriteAtConstruction(method);
not_null<serialization::GetVersion::Out*> const out =
get_version->mutable_out();
out->set_build_date(base::BuildDate);
out->set_version(base::Version);
out->set_build_date(BuildDate);
out->set_version(Version);
active_recorder_->WriteAtDestruction(method);
}

Expand Down
1 change: 1 addition & 0 deletions ksp_plugin/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ using quantities::si::Second;
using quantities::si::Tonne;
using ::google::protobuf::Arena;
using ::google::protobuf::ArenaOptions;
using ::operator<<;
using namespace principia::base::_array;
using namespace principia::base::_fingerprint2011;
using namespace principia::base::_flags;
Expand Down
6 changes: 3 additions & 3 deletions ksp_plugin/part_subsets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

namespace principia {

using base::make_not_null_shared;
namespace base {

using geometry::Instant;
using ksp_plugin::Barycentric;
using ksp_plugin::Part;
using ksp_plugin::PileUp;
using physics::DegreesOfFreedom;
using physics::Ephemeris;

namespace base {
using namespace principia::base::_not_null;

Subset<Part>::Properties::Properties(not_null<ksp_plugin::Part*> const part) {
if (part->is_piled_up()) {
Expand Down
1 change: 0 additions & 1 deletion ksp_plugin_test/flight_plan_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ namespace principia {
namespace ksp_plugin {

using astronomy::J2000;
using base::make_not_null_shared;
using geometry::Barycentre;
using geometry::Displacement;
using geometry::Instant;
Expand Down

0 comments on commit 87ba4d0

Please sign in to comment.