Ver Mensaje Individual
  #13 (permalink)  
Antiguo 10/03/2016, 15:00
Avatar de detective_jd
detective_jd
 
Fecha de Ingreso: abril-2011
Ubicación: Salto
Mensajes: 437
Antigüedad: 13 años
Puntos: 6
Respuesta: headers, carpetas y menúes c++

Hola eferion, gracias por responder, verás pude con el problema de c++11, lo que tenía que hacer era en propiedades del proyecto, luego a c++ compiler y en c++ standard pongo c++11 y solucionado, sólo q en ManPersonas.h muestra pocos errores:

Código C++:
Ver original
  1. #include <algorithm>
  2. #include <list> // error - In file included from
  3. #include "Persona.h"
  4. #ifndef CONTRPERSONAS_H
  5. #define CONTRPERSONAS_H
  6. using namespace std;    
  7.     std::list<Persona>lista;
  8.     static int maxIdP = 0;
  9.     int getMaxIdP(){
  10.         return ++maxIdP;
  11.     }
  12.     bool check(const Persona& p){
  13.         int num_reg = std::count_if(lista.begin(),lista.end(),[&p](const Persona& p2){
  14.             return p2.nom == p.nom;
  15.         });
  16.         return num_reg > 0;
  17.     }
  18.     Persona* getRow(std::string xnom){
  19.         Persona* toReturn = NULL; // inicialización de puntero nulo
  20.         auto it = std::find_if(lista.begin,lista.end,[&xnom](const Persona& p){
  21.             return p.nom == xnom;
  22.         }); // error - no matching function for call to find_if
  23.         if( it != lista.end())
  24.             toReturn = &(it); // it
  25.         return toReturn;
  26.     }
  27.     Persona* getRow(int xid){
  28.         Persona* toReturn = NULL; // inicialización de puntero nulo
  29.         auto it = std::find_if(lista.begin,lista.end,[&xid](const Persona& p){
  30.             return p.id == xid;
  31.         }); // error - no matching function for call to find_if
  32.         if( it != lista.end())
  33.             toReturn = &(it); // it
  34.         return toReturn;
  35.     }
  36.     bool create(Persona p){
  37.         if(check(p)){            
  38.             return false;
  39.         }
  40.         else{
  41.             lista.push_back(p);
  42.             return true;
  43.         }
  44.     }
  45.     bool update(Persona p){ }
  46.     void remove(Persona p){
  47.         if(check(p)){
  48.             lista.remove(p); // error - in file included from
  49.         }
  50.     }
  51.     std::list<Persona> read(){
  52.         return lista;        
  53.     }  
  54. #endif  /* CONTRPERSONAS_H */

Espero sus respuestas y saludos