Skip to content

Commit

Permalink
trying different standard library
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Dec 17, 2023
1 parent b059d07 commit 71d0c5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ set(CMAKE_CXX_EXTENSIONS OFF)

include(cmake/dependencies.cmake)

# on ubuntu with clang, an incorrect version of the c++ standard library was being linked
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux" AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# If the compiler is Clang, use libc++
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()

################################################################################
# targets

Expand Down
8 changes: 7 additions & 1 deletion src/day17.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
#include <string>
#include <vector>
#include <benchmark/benchmark.h>
#include <numeric_limits>

struct Data {

std::vector<std::string> grid;
};

std::pair<std::vector<std::vector<int>>, std::vector<std::vector<int>>> dijkstra(const Data& d) {
std::vector<std::vector<int>> dist(d.grid.size(), std::vector<int>(d.grid[0].size(), std::numeric_limits<int>::infinity()));
}

int part1(const Data &data)
{
return 0;
Expand All @@ -27,6 +32,7 @@ Data parse()

while (std::getline(file, line))
{
data.grid.push_back(line);
}

return data;
Expand Down

0 comments on commit 71d0c5e

Please sign in to comment.