#include <algorithm>
#include <iostream>
// Based on Richard Smith trick for constexpr lambda
// via Paul Fultz II (http://p...content-available-to-author-only...2.com/blog/2014/09/02/static-lambda/)
template<typename T> 
auto addr(T &&t) 
{ 
    return &t; 
}


static const constexpr auto odr_helper = true ? nullptr : addr([](){});

template <class T = decltype(odr_helper)>
inline void g() {
    int arr[2] = {};
    std::for_each(arr, arr+2, [] (int i) {std::cout << i << ' ';});
}

int main()
{

    g();
}