Skip to content

Commit

Permalink
Fix: Missing STL-compat imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvardanian committed Feb 20, 2024
1 parent 4c738ea commit ec8abc2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
3 changes: 3 additions & 0 deletions include/stringzilla/stringzilla.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@
#endif

#if !SZ_AVOID_STL
#include <array>
#include <bitset>
#include <string>
#include <vector>
#if SZ_DETECT_CPP_17 && __cpp_lib_string_view
#include <string_view>
#endif
#endif

#include <cassert> // `assert`
#include <cstddef> // `std::size_t`
#include <cstdint> // `std::int8_t`
#include <iosfwd> // `std::basic_ostream`
#include <stdexcept> // `std::out_of_range`
#include <utility> // `std::swap`
Expand Down
28 changes: 15 additions & 13 deletions scripts/test.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
#undef NDEBUG // Enable all assertions
#include <cassert> // assertions

// Overload the following with caution.
// Those parameters must never be explicitly set during releases,
// but they come handy during development, if you want to validate
// different ISA-specific implementations.
// #define SZ_USE_X86_AVX2 0
// #define SZ_USE_X86_AVX512 0
// #define SZ_USE_ARM_NEON 0
// #define SZ_USE_ARM_SVE 0
#define SZ_DEBUG 1 // Enforce aggressive logging for this unit.

// Put this at the top to make sure it pulls all the right dependencies
#include <stringzilla/stringzilla.hpp>

#if defined(__SANITIZE_ADDRESS__)
#include <sanitizer/asan_interface.h> // ASAN
#endif
Expand All @@ -14,19 +27,8 @@
#include <sstream> // `std::ostringstream`
#include <vector> // `std::vector`

// Overload the following with caution.
// Those parameters must never be explicitly set during releases,
// but they come handy during development, if you want to validate
// different ISA-specific implementations.
// #define SZ_USE_X86_AVX2 0
// #define SZ_USE_X86_AVX512 0
// #define SZ_USE_ARM_NEON 0
// #define SZ_USE_ARM_SVE 0
#define SZ_DEBUG 1 // Enforce aggressive logging for this unit.

#include <string> // Baseline
#include <string_view> // Baseline
#include <stringzilla/stringzilla.hpp> // Contender
#include <string> // Baseline
#include <string_view> // Baseline

#if !SZ_DETECT_CPP_11
#error "This test requires C++11 or later."
Expand Down

0 comments on commit ec8abc2

Please sign in to comment.