Skip to content
/ tiger Public

A library of highly specialized containers and algorithms, such as compile-time heterogenous type containers or x86 SIMD/AVX2 register strings.

Notifications You must be signed in to change notification settings

ayushgun/tiger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tiger

A library of highly specialized containers and algorithms, such as compile-time heterogenous type containers or x86 AVX2 register strings.

Type Map

#include <iostream>
#include <tiger/types/type_map.hpp>

int main() {
  tgr::tmap<int, double, char> map(1, 1.0, 'a');

  // Access value by type -- O(1)
  std::cout << tgr::tmap_get<char>(map) << '\n';

  // Iterate over all values -- O(n)
  tgr::for_each(map, [](const auto& value) { std::cout << value << '\n'; });
}

Type Set

#include <iostream>
#include <tiger/types/type_set.hpp>
#include <type_traits>

int main() {
  tgr::tset<int, double, char*> set;

  // Check for type existence -- O(1)
  std::cout << tgr::tset_contains<int>(set) << '\n';

  // Iterate over all types -- O(n)
  tgr::for_each(set, [](auto node) {
    using T = typename decltype(node)::type;
    if (std::is_arithmetic_v<T>) {
      std::cout << "Arithmetic type found\n";
    }
  });
}

Short String

#include <algorithm>
#include <iostream>
#include <tiger/simd/short_string.hpp>

int main() {
  tgr::short_string s = "Hello World";

  // Interoperability with STL APIs
  std::sort(s.begin(), s.end());
  std::cout << s << '\n';
  std::cout << s.size() << '\n';
}

About

A library of highly specialized containers and algorithms, such as compile-time heterogenous type containers or x86 SIMD/AVX2 register strings.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published