Skip to content

Instantly share code, notes, and snippets.

@serg06
serg06 / FindBoost.cmake
Created January 7, 2020 06:46 — forked from thiagowfx/FindBoost.cmake
FindBoost.cmake (DONT'T DELETE THIS! It's linked in a Stack Overflow answer)
# - Find Boost
#
# Copyright (c) 2016 Thiago Barroso Perrotta
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
@serg06
serg06 / interval_map.h
Last active May 30, 2024 10:24
[C++] Short IntervalMap data structure implementation
/*
* NOTE 1: This works on VC++ but might need a little extra syntax to work on GCC.
* NOTE 2: It breaks when calling set_interval on the minimum key (std::numeric_limits<K>::lowest()) and maybe on the maximum key too.
*
* OPERATIONS:
*
* N = number of unique intervals. (Neighboring intervals with the same value are joined.)
* Iterators run in key-sorted order. (Or reverse, if you like - they're bidirectional.)
*
* get_min(): O(1)