Just a test to see whether we can get the rendered markdown via the API.
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 <iterator> | |
#include <string> | |
#include <boost/spirit/include/qi.hpp> | |
namespace qi = boost::spirit::qi; | |
template <typename Iterator> | |
struct mini_grammar : qi::grammar<Iterator, qi::ascii::space_type> { |
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
#ifndef TEST_HASHMAP_HPP | |
#define TEST_HASHMAP_HPP | |
#include <vector> | |
namespace test { | |
template <typename F, typename S> | |
struct pair; |
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
#!/bin/bash | |
set -e | |
set -u | |
# This script runs assertions that should fail at compile-time. | |
# This precludes the use of a conventional test runner. Instead, we build a | |
# harness and capture whether specific test cases compile successfully or | |
# not. | |
# Some preliminary definitions. |
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 "multicast.hpp" | |
void f(int n) { | |
std::cout << "f(" << n << ")\n"; | |
} | |
struct g { | |
void operator ()(int n) { |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace CsConsole | |
{ | |
class MainClass | |
{ | |
static void WalkTypes(IEnumerable<Type> types, Action<Type> action) { | |
foreach (var nested in types) |
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 <typeinfo> | |
#include <iostream> | |
#include <vector> | |
#include <stdexcept> | |
#include <unordered_map> | |
struct Type { | |
std::string name; | |
std::vector<Type*> parents; | |
// TODO Extend by fully-qualified name (namespace) etc. |
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 <typename... T> | |
constexpr auto make_array(T&&... values) -> | |
std::array< | |
typename std::decay< | |
typename std::common_type<T...>::type>::type, | |
sizeof...(T)> { | |
return {std::forward<T>(values)...}; | |
} |
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
public static long CountDiv1(int a, int b, int k) { | |
if (k < 0) | |
return CountDiv1(a, b, -k); | |
// Adapt this if one of the bounds is exclusive. | |
long range = (long) b - (long) a + 1; | |
// Get the rough number of elements in the range. | |
long number = range / k; |
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.h> | |
#include <stdio.h> | |
int main(void) { | |
char * str = "hello, world"; | |
for (int i = 0; i < strlen(str); ++i | |
printf("%c ", str[i]); | |
printf("\n"); | |
} |