Question: How to add an entry in to the iPhone system settings to add custom service authentication? 
How to link it with the My Application?

I am looking something similar to Facebook and Twitter options available in the System settings for authentication.

Answer: 
```
vec c;
c.reserve(a.size());
std::transform(a.begin(), a.end(), b.begin(),
               std::back_inserter(c),
               std::max<double>);

```
Igor's solution is great, but I had trouble compiling it. I found I needed to wrap std::max in an anonymous function to get it to compile.

Here are two template functions which allow taking the pairwise maximum for an arbitrary number of vectors:

```
// pairwise maximum                                               
template<typename T>                                              
vector<T> pmax(const std::vector<T>& a, const std::vector<T>& b) {
    std::vector<T> c;                                             
    assert(a.size() == b.size());                                 
    c.reserve(a.size());                                          
    std::transform(a.begin(), a.end(), b.begin(),                 
                   std::back_inserter(c),                         
                   [](T a, T b) { return std::max<T>(a, b); });   
    return c;                                                     
}                                                                 

// maximum of all vectors
template<typename T>                                                      
vector<T> vpmax(const std::vector<std::vector<T>>& vv) {                  
    std::vector<T> c;                                                     
    if (vv.empty()) return c;                                             
    c = vv.front();                                                       
    typename std::vector<std::vector<T> >::const_iterator v = vv.begin(); 
    ++v; // skip the first element                                        
    for ( ; v != vv.end(); ++v) {                                         
        c = pmax(c, *v);                                                  
    }                                                                     
    return c;                                                             
}

```