View sfinae.cpp
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
// У нас есть специализация | |
template<class T> | |
class vector { | |
}; | |
template<> | |
class vector<bool> { |
View erase-remove.cpp
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 <algorithm> | |
#include <iostream> | |
#include <vector> | |
struct T { | |
~T() { | |
std::cout << "destroy" << std::endl; | |
} | |
}; |
View Monads.hs
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
module Lib where | |
import Control.Monad (replicateM) | |
someFunc :: IO () | |
someFunc = undefined | |
a, b, m :: Int | |
a = 179 | |
b = 239 |
View boost_voronoi.cpp
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 <algorithm> | |
#include <iostream> | |
#include <vector> | |
#include <boost/polygon/voronoi.hpp> | |
using namespace std; | |
using boost::polygon::voronoi_diagram; | |
using boost::polygon::voronoi_builder; | |
using boost::polygon::construct_voronoi; |
View comparable.cpp
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 <memory> | |
class Comparable { | |
public: | |
virtual int compareTo(const Comparable& other) const = 0; | |
}; | |
class Int : public Comparable { | |
int value; |
View auto_ptr.cpp
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> | |
struct point { | |
int x, y; | |
point() { | |
std::cout << "Construct " << this << std::endl; | |
} | |
~point() { |
View Makefile
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
all: main | |
bin: | |
mkdir bin | |
bin/aclass.o: src/aclass.cpp | bin | |
g++ -c -g -Iinclude -std=c++11 src/aclass.cpp -o bin/aclass.o | |
bin/main.o: src/main.cpp | bin | |
g++ -c -g -Iinclude -std=c++11 src/main.cpp -o bin/main.o |
View integer_set.cpp
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 <vector> | |
#include <algorithm> | |
class integer_set { | |
public: | |
using const_iterator = std::vector<int>::const_iterator; | |
integer_set() { } |
View vector.cpp
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 "vector.h" | |
vector_int::vector_int() { | |
size_ = 0; | |
capacity_ = 16; | |
data_ = new int[capacity_]; | |
} | |
void vector_int::reserve(size_t new_size) { | |
if (new_size <= capacity_) |
View expat.c
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 <stdio.h> | |
#include <stddef.h> | |
#include <expat.h> | |
#define UNUSED(x) (void)(x) | |
#ifdef XML_UNICODE_WCHAR_T | |
# include <wchar.h> | |
# define XML_FMT_STR "ls" | |
#else |
NewerOlder