This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <utility> | |
class Hashable | |
{ | |
public: | |
Hashable(const std::string& s1, const std::string& s2): | |
s1(s1), | |
s2(s2) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <optional> | |
#include <string> | |
#include <utility> | |
class Node | |
{ | |
public: | |
virtual ~Node() = default; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EmptyClass | |
{ | |
virtual ~EmptyClass() = default; | |
}; | |
class DerivedFromEmpty: public EmptyClass | |
{ | |
bool operator==(const DerivedFromEmpty&) const = default; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdexcept> | |
class IName | |
{ | |
public: | |
virtual const std::string& name() const = 0; | |
}; | |
class EqualNode: public IName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cassert> | |
enum class C | |
{ | |
LINEAR, | |
NON_LINEAR, | |
CONSTANT | |
}; | |
C operator+(C x, C y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cassert> | |
#include <mutex> | |
#include <vector> | |
class IMutex | |
{ | |
public: | |
virtual void lock() = 0; | |
virtual void unlock() noexcept = 0; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <map> | |
#include <cmath> | |
using uint = unsigned int; | |
std::map<std::string, uint> getRawNumberCoresPerLevel(uint nbLogicalCores) | |
{ | |
std::map<std::string, uint> table; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Poly | |
{ | |
public: | |
virtual std::string name() const = 0; | |
virtual ~Poly() = default; | |
}; | |
class Impl1 : public Poly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WatchedConstraint | |
{ | |
public: | |
WatchedConstraint(std::string name, std::string regexID, std::string infeasibility, std::string infeasibilityCause) : | |
name(name), | |
regexID(regexID), | |
infeasibility(infeasibility), | |
infeasibilityCause(infeasibilityCause) { | |
} | |
std::string formattedInfeasibility(std::string constraintName) const { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <map> | |
int main() { | |
std::map<int, int> m; | |
auto display_m = [&m](const char *msg) { | |
std::cout << msg << " "; | |
for (auto [k, v] : m) { | |
std::cout << "m[" << k << "] = " << v << std::endl; | |
} |
NewerOlder