#include <stdio.h>
struct tester {
    tester(const tester&x) { printf("copied\n"); }
    tester() { printf("default\n"); }
};
template<typename FUNC>
void callconstref(const FUNC& f)
{
    f(1);
}
template<typename FUNC>
void callref(FUNC& f)
{
    f(1);
}

template<typename FUNC>
void callbyvalue(FUNC f)
{
    f(1);
}

int main(int,char**)
{
    tester obj;
    printf("constref(&)\n");
    callconstref([&obj](int x) { printf("%d\n", x); });
//  printf("ref(&)\n");
//  callref([&obj](int x) { printf("%d\n", x); });
    printf("byvalue(&)\n");
    callbyvalue([&obj](int x) { printf("%d\n", x); });

    printf("constref()\n");
    callconstref([obj](int x) { printf("%d\n", x); });
//  printf("ref()\n");
//  callref([obj](int x) { printf("%d\n", x); });
    printf("byvalue()\n");
    callbyvalue([obj](int x) { printf("%d\n", x); });
    return 0;
}
