Skip to content
Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Category: C++

C++ Guru Question

elbeno, 11 August, 201430 June, 2015

Wondering about this… template argument deduction succeeds for the explicitly-typed variable, fails in the auto case. (Also, it succeeds either way for an equivalently-typed unary operator template). template struct Foo { T m_t; }; template Foo operator/=(Foo foo, function fn) { return fn(foo.m_t); } void mystery() { auto foo =…

An Interesting C++ Technique

elbeno, 26 August, 201330 June, 2015

I recently discovered a C++ technique I haven’t seen recognized before in any books, articles, or mentioned online anywhere (search terms are difficult perhaps). For want of a better name I call it Structural Capture. Consider the following code: #include #include using namespace std; //————————————————————— struct Foo { template Foo(const…

  • Previous
  • 1
  • …
  • 6
  • 7
©2026 Why is a raven like a writing desk? | WordPress Theme by SuperbThemes