andrey-golubev / clsc Goto Github PK
View Code? Open in Web Editor NEWCute Little Software Capital
License: BSD 3-Clause "New" or "Revised" License
Cute Little Software Capital
License: BSD 3-Clause "New" or "Revised" License
For example:
template< class ForwardIt, class UnaryPredicate, class Compare >
ForwardIt lower_bound( ForwardIt first, ForwardIt last, UnaryPredicate pred, Compare cmp );
Add those just for fun. Draft implementation of one (but requires C++17 - can it be done in C++14?):
#include <type_traits>
template <template <typename, typename> class BinaryPredicate, typename... Ts>
struct all_of {
static constexpr bool value = (BinaryPredicate<float, Ts>::value && ...);
};
template <template <typename, typename> class BinaryPredicate, typename T>
struct all_of<BinaryPredicate, T> {
static constexpr bool value = BinaryPredicate<float, T>::value;
};
int main() {
static_assert(all_of<std::is_same, float>::value, "Failed");
static_assert(all_of<std::is_same, float, float>::value, "Failed");
static_assert(!all_of<std::is_same, float, float, float, int>::value, "Failed");
static_assert(!all_of<std::is_same, float, double, int>::value, "Failed");
return 0;
}
When having an array of certain items (e.g. callables), sometimes one wants to be able to seamlessly access a specific item. In a usual setup, array implies indices (integer values) which are not super convenient to use "as is".
Having a facade that translates user-specified item identifier (namely, a string) into an index of an array and then accesses the array element by an index, would significantly simplify life in certain cases.
It feels that the most natural usage for such idea is when a programmer actually has to write code by himself (not auto-called by some routine), thus, having a constexpr associative container (string -> int, 1-to-1 mapping) is a good enough option to go with.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.