Skip to content

Commit

Permalink
xcode 14 does not support std::make_shared<index1_type[]> even with C…
Browse files Browse the repository at this point in the history
…++20
  • Loading branch information
evaleev committed Jan 17, 2024
1 parent a172b44 commit 98c6c3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/TiledArray/tiled_range1.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,12 @@ class TiledRange1 {
if (!elem2tile_) {
// initialize elem2tile map
auto e2t =
#if __cplusplus >= 202002L
std::make_shared<index1_type[]>(n);
#else
// #if __cplusplus >= 202002L ... still broken in Xcode 14
// std::make_shared<index1_type[]>(n);
// #else
std::shared_ptr<index1_type[]>(
new index1_type[n], [](index1_type* ptr) { delete[] ptr; });
#endif
// #endif
const auto end = extent(range_);
for (index1_type t = 0; t < end; ++t)
for (index1_type e = tiles_ranges_[t].first;
Expand Down

1 comment on commit 98c6c3b

@bimalgaudel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we must:

#if __cpp_lib_shared_ptr_arrays >= 201707L
std::make_shared<index1_type[]>(n);
#else
std::shared_ptr<index1_type[]>(
                new index1_type[n], [](index1_type* ptr) { delete[] ptr; });
#endif

Please sign in to comment.