Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

100
Vistas
Does copy elision exist in C?

As I read about copy elision, many of the sources only mention C++ and not C.

They state how the C++ standard allows this optimization to take place if the compiler decides it is the right thing to do.

But what about C? Do C compilers perform copy elision, or does the C standard gaurentee that copies will never be optimized away?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Both C and C++ allow any optimizations that follow the as-if rule. Since C doesn't have constructors - and therefore constructors with side-effects- copies may be elided without breaking this rule. C++ on the other hand needs to make a special case where an implementation is allowed to break as-if.

So, copy elision exists in C implicitly through the as-if rule.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda