I'm reading a book on C++ templates by Vandevoorde, Josuttis and Gregor and do not understand the warning they make about dangling reference.
Here is the code:

```
#include <cstring>

// maximum of two values of any type (call-by-reference)
template<typename T>
T const& max (T const& a, T const& b)
{
  return  b < a ? a : b;
}

// maximum of two C-strings (call-by-value)
char const* max (char const* a, char const* b)
{
  return  std::strcmp(b,a) < 0  ? a : b;
}

// maximum of three values of any type (call-by-reference)
template<typename T>
T const& max (T const& a, T const& b, T const& c)
{
  return max (max(a,b), c);       // error if max(a,b) uses call-by-value
}

int main ()
{
  auto m1 = ::max(7, 42, 68);     // OK

  char const* s1 = "frederic";
  char const* s2 = "anica";
  char const* s3 = "lucas";
  auto m2 = ::max(s1, s2, s3);    // run-time ERROR
}

```

The given message is that for C-string the nested `max(a,b)` creates a dangling reference, whereas for int's it does not.
So what is so special about pointer to char in comparison to reference to int, given that both are implemented as pointers to objects allocated outside `max` functions?