Brett 2023-12-08 20:11:58 -05:00
parent 8defbaf70d
commit a4220e3c0d
2 changed files with 42 additions and 22 deletions

View File

@ -22,12 +22,13 @@
#include <optional> #include <optional>
#if defined(__GNUC__) #if defined(__GNUC__)
#include <cxxabi.h> #include <cxxabi.h>
#include <blt/compatibility.h> #include <blt/compatibility.h>
#include <string> #include <string>
namespace blt namespace blt
{ {
static BLT_CPP20_CONSTEXPR inline std::string demangle(const std::string& str) static BLT_CPP20_CONSTEXPR inline std::string demangle(const std::string& str)
{ {
int status; int status;
@ -39,25 +40,39 @@
std::free(demangled_name); std::free(demangled_name);
return ret_name; return ret_name;
} }
} }
#else #else
namespace blt namespace blt
{ {
static BLT_CPP20_CONSTEXPR inline std::string demangle(const std::string& str) static BLT_CPP20_CONSTEXPR inline std::string demangle(const std::string& str)
{ {
return str; return str;
} }
} }
#endif #endif
namespace blt namespace blt
{ {
template<typename TYPE_ITR>
template<typename BEGIN, typename END>
class enumerate class enumerate
{ {
private: private:
size_t index = 0;
TYPE_ITR begin;
TYPE_ITR end;
public:
class enumerate_itr
{
public:
using iterator_category = std::input_iterator_tag;
using value_type = typename TYPE_ITR::value_type;
using difference_type = typename TYPE_ITR::difference_type;
using pointer = typename TYPE_ITR::pointer;
using reference = typename TYPE_ITR::reference;
private:
size_t index = 0;
public:
};
}; };
#if defined(__GNUC__) || defined(__llvm__) #if defined(__GNUC__) || defined(__llvm__)

View File

@ -36,6 +36,10 @@ void printLines(const std::vector<std::string>& lines)
std::cout << v << "\n"; std::cout << v << "\n";
} }
void testEnumerate(const std::vector<std::string>& test){
}
void getfucked(){ void getfucked(){
BLT_ASSERT(false); BLT_ASSERT(false);
} }
@ -65,6 +69,7 @@ void blt::test::utility::run()
tableTest.addRow({"Sleeping Together (Sexual)", "10,000"}); tableTest.addRow({"Sleeping Together (Sexual)", "10,000"});
tableTest.addRow({"Relationship (I would do anything for you)", "1,000,000,000,000"}); tableTest.addRow({"Relationship (I would do anything for you)", "1,000,000,000,000"});
testEnumerate(tableTest.createTable(true, true));
printLines(tableTest.createTable(true, true)); printLines(tableTest.createTable(true, true));