Skip to content

Instantly share code, notes, and snippets.

View yifu's full-sized avatar

Yves Baumes yifu

  • Montpellier, France
View GitHub Profile
#include <iostream>
using namespace std;
class X {
public:
X() {
cout << "Constructor 1" << endl;
}
X(const X& h) {
@yifu
yifu / gist:3552823
Created August 31, 2012 13:44
Four clojure pbs.
(ns mynamespace)
;; SEQUENCE REVERSE.
(def __ (fn seq-reverse [v]
(if (empty? v)
(empty v)
(conj (seq-reverse (butlast v)) (last v)))))
(def __ (fn seq-reverse [[a & rest]]
#include <iostream>
#include <string>
using namespace std;
int main()
{
wstring result = L"hello";
cout << "hello world." << endl;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <map>
#include <utility>
using namespace std;
typedef map<int,int> my_map;
// WARNING: Altering the std namespace is UB.
#include <algorithm>
#include <iostream>
#include <iterator>
#include <string>
#include <vector>
using namespace std;
int main()
{
cout << "hello world." << endl;
#include <fstream>
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world." << std::endl;
ofstream book("test.txt");
@yifu
yifu / nrvo.cpp
Created September 18, 2012 15:09
#include <iostream>
using namespace std;
class X {
public:
X() {
cout << "Constructor 1" << endl;
}
X(const X& h) {
#include <iostream>
#include <map>
#include <string>
using namespace std;
/******************************************************/
/** Purpose: verify the default value for int as ******/
/** a value in a map (value opposed to a key) ******/
/******************************************************/
#include <algorithm>
#include <iostream>
#include <iterator>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// --------------------------------------------------------------------------
#include <string>
#include <cstring>
int main()
{
// const std::string test (0/*NULL*/);
const std::string test (0/*NULL*/, std::strlen(0));
}