[ create a new paste ] login | about

Link: http://codepad.org/PiClDyzn    [ raw code | output | fork ]

C++, pasted on Oct 10:
#include <cstdio>
#include <cstring>

template <size_t N>
void f(char (&S)[N])
{
  strncpy(S, "でも魅魔様の搾乳ならちょっと見たいかも", N);
}
class A{
  char aaa[64];
public:
  typedef char (&S)[64];
  operator S()
  {
    return aaa;
  }
};
int main()
{
  A a;
  f(a);
  puts(a);
  return 0;
}


Output:
1
2
3
In function 'int main()':
Line 21: error: no matching function for call to 'f(A&)'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: