using std::cpp conference becomes bilingual (and remains free)

Yes you got it. The spanish C++ one-day conference, using std::cpp, will be bilingual this year.

The conference will be having this year its 6th edition. The event will be on March 7th 2019 in Madrid. And this year there will be a number of talks in English.

  • Long talks (40 min.): 6 in English and 1 in Spanish
  • Short talks (20 min.): 1 in English and 3 in Spanish
  • Flash talks (5 min.): 2 in English.

As the reader can notice more of the half of the one day conference is offered in English.

Speakers in using std::cpp 2019 include among others Arno Schödl (Think-Cell Software), Guy Davidson (Creative Assembly), Axel Naumann (CERN), Joaquin M. López (author of Boost libraries MultiIndex, Flyweight, PolyCollection) and J. Daniel Garcia (ISO C++ committee member).

You can access the full program here.

The C++ conference using std::cpp 2019 will be hosted at University Carlos III of Madrid, in Leganés. It is a free event, but registration is needed. You can register for the conference here.

Organized by:

          

Gold Sponsor:

Indizen

Silver Sponsors:

Conan             Think-Cell

With the cooperation of:

JetBrains
Manning

Publicado en cpp-posts, eventos, Lenguaje C++

Conferencias de Bjarne Stroustrup en Madrid

El próximo día 25 de enero tendrá lugar la investidura como Doctor Honoris Causa por la Universidad Carlos III de Madrid, del profesor Bjarne Stroustrup, creador del lenguaje de programación C++.
Con este motivo, hemos preparado dos conferencias, que espero que sean de vuestro interés para el jueves 24 de enero.
Las conferencias tendrán lugar en la Escuela Politécnica Superior de la Universidad Carlos III de Madrid, en Leganés.
IMPORTANTE: Es necesario inscribirse para asistir ya que el aforo es limitado.
Además, aprovecho la ocasión para recordaros que el día 22 de enero, se celebra en Madrid un meetup de C++, donde el Profesor Bjarne Stroustrup impartirá otra conferencia. Toda la información sobre dicho evento la puedes encontrar aquí: https://www.meetup.com/es-ES/Madrid-C-Cpp/events/257896267/
Publicado en cpp-posts, eventos, Lenguaje C++

Nuevo curso: Programación avanzada en C++ – C++11/14/17

La fundación Universidad Carlos III de Madrid, organiza un curso avanzado de C++. Este curso está dirigido a desarrolladores con experiencia que quieren actualizarse a las últimas versiones del lenguaje.

Toda la información del curso se puede obtener en el siguiente enlace.

El curso está estructurado en cuatro módulos:

  • Parte I: Lenguaje.
  • Parte II: La biblioteca estándar.
  • Parte III: Concurrencia.
  • Parte IV: Introducción a C++17.

El curso se celebra en marzo, pero la inscripción ya está abierta y las plazas son limitadas.

Publicado en eventos, Lenguaje C++, misc

Using std::cpp está de vuelta y sigue siendo gratis

Si. Ya lo sabemos. Todos esperabais que en noviembre nos viésemos otra vez en la Universidad Carlos III de Madrid (como todos los años) para la sexta edición de vuestra conferencia favorita sobre C++. Sin embargo, no va a ser así, porque hemos retrasado la fecha de la conferencia.

Sin embargo, tenemos dos buenas noticias: using std::cpp va a seguir siendo un evento gratuito y ya tenemos fecha para el evento.

Seguimos siendo un evento gratuito

Después del año pasado hemos estado considerando la posibilidad de hacer de using std::cpp un evento con una cuota de inscripción. Había varias razones para ello: como poder mejorar la calidad del evento, financiar viajes de ponentes internacionales, o evitar que personas se registren y luego cancelen su asistencia en el último minuto.

Sin embargo, vamos a mantener este año el evento en su formato tradicional y como un evento gratuito. Intentaremos suplir esto con la búsqueda de más patrocinadores. Dependiendo del nivel de patrocinio que consigamos, podremos hacer más o menos cosas.

Pero necesitamos patrocinadores

Así que ya sabes. Si has venido otros años. Si crees que este evento es útil, quizás puedas convencer a tu empresa para que colabore como patrocinador de using std::cpp 2019.

Y ya tenemos fecha

Si. Ya tenemos fecha. La conferencia en España de C++ será el jueves 7 de marzo en el mismo lugar que siempre (la Escuela Politécnica Superior de la Universidad Carlos III de Madrid)

Publicado en eventos, Lenguaje C++

Ofertas de empleo interesantes en GMV

Me han llegado dos ofertas de empleo interesantes en la empresa GMV.

Oferta 1: https://www.gmv.com/es/Empleo/Vacantes/827.html

Ingeniero Simulación Misiones Espaciales • Descripción: “Ingeniero de proyecto encargado de desarrollar elementos software (C/C++, Matlab) para la simulación de misiones espaciales de observación de la Tierra (instrumentos, entorno, procesado de datos). La plaza requiere la capacidad de entender, analizar, mejorar y, en algunos casos, diseñar algoritmos físicos complejos para luego implementarlos en C/C++ o Matlab. Las tareas principales que deberá realizar el candidato seleccionado son:

  • Análisis de documentación técnica describiendo la funcionalidad a simular relacionada con la misión espacial.
  • Análisis y/o definición de algoritmos que permiten simular la misión o Codificación y pruebas unitarias en C/C++
  • Matlab de esos algoritmos. o Integración y orquestación de los algoritmos en una o varias aplicaciones.
  • Integración y validación de aplicaciones externas.
  • Pruebas de sistema.
  • Documentación de todo el proceso (desde requisitos/diseño a informes de validación).
  • Formación: Físico, Ingeniero de Telecomunicaciones
  • Aeronaútico, Ingeniero Informático
  • Experiencia: 0-3 años
  • Conocimientos necesarios: C/C++ (medio), Unix (medio), Matlab (medio), Teoría de la señal (medio), Inglés (avanzado)
  • Conocimientos valorados: Misiones Espaciales (básico), Instrumentos de Observación de la Tierra (básico)

Oferta 2: https://www.gmv.com/es/Empleo/Vacantes/818.html

Ingeniero SW para Instrumentos Espaciales • Descripción: “Ingeniero de proyecto encargado de desarrollar elementos software en C/C++ para la simulación de cargas de pago de misiones espaciales de observación de la Tierra. La plaza combina habilidades de ingeniería del software que permitan generar código C/C++ eficiente (los requisitos de carga computacional y prestaciones son estrictos), con la capacidad de entender y analizar algoritmos físicos complejos. Las tareas principales que deberá realizar el candidato seleccionado son:

  • Diseño de arquitecturas software eficientes para el desarrollo de librerías y aplicaciones.
  • Codificación y pruebas unitarias en C/C++ de algoritmos bien definidos y de las librerías de infraestructura necesarias para el sistema.
  • Integración y orquestación de las algoritmos en una aplicación monolítica, incluyendo entrada/salida de ficheros.
  • Pruebas de sistema.
  • Documentar los resultados de la validación y corrección de no conformidades.
  • Formación: Ingeniero Informático, Ingeniero de Telecomunicaciones o Aeronaútico, Físico
  • Experiencia: 2-5 años
  • Conocimientos necesarios: C/C++ (avanzado), Computación Paralela (medio), Unix (medio), Matlab (medio), Inglés (avanzado)
  • Conocimientos valorados: Misiones Espaciales (básico), Instrumentos de Observación de la Tierra (básico)
Publicado en misc | Etiquetado , ,

Jacksonville’18 ISO C++ Report

This week the ISO C++ committee met in Jacksonville, Florida. This is the first meeting of this year. We will meet again in Summer (Rapperswil, Switzerland) and Fall (San Diego, California).

As you may well know the committee is working in what it will be C++20 (and deciding what could end up delayed for C++23).

Let me give a summary of some of the things we decided today in plenary. As always we decided to approve the resolutions solving a number of defect reports both in the library and in the language. Usually this are corner cases and leave to others (or to me in the future) to explain them.

In this post you will find information only about the language and the library for C`20. I defer reporting on TS (technical specifications) to a separate post.

C++20 Language

Language support for empty objects

A new attribute [[no_unique_address]] has been added to indicate that a unique address is not required for a non static data member. Such data member can the share its address with another object if it could have zero size (as in the empty base optimization) and both have distinct types:

template<typename Key, typename Value, typename Hash, typename Pred, typename Allocator>
class hash_map {
  [[no_unique_address]] Hash hasher;
  [[no_unique_address]] Pred pred;
  [[no_unique_address]] Allocator alloc;
  Bucket *buckets;
  // ...
public:
  // ...
};

Then hasher, pred, and alloc may have the same address than buckets (if they have zero size).

Relaxed support for range-based for loops

This solves corner cases for range-based for. Surprise or not, today you cannot write a range-based for loop over data coming for an input stream without writing some adaptor class. The problem is that seekdir::end is found and this makes impossible to properly find begin() and end().

This is an example of code that does not work in C++17, but will work in C++20.

struct X : std::stringstream { /*...*/ };

std::istream_iterator<char> begin(X& x) {
    return std::istream_iterator<char>(x);
}

std::istream_iterator<char> end(X& x) {
    return std::istream_iterator<char>();
}

int main() {
    X x;
    for (auto && i : x) {
      // ...	      
    }
}

Allow structured bindings to accessible members

C++17 introduced structured bindings making it possible to bind only to public data members. C++20 exteds this to the case of accessible data members. This solves problems with using them in friend functions.

struct A { 
  friend void f(); 
private: 
  int x; 
}; 

struct B : private A {
  friend void g();
};

void f() { 
  A a; 
  auto x = a.x; // OK 
  auto [y] = a; // Allowed by this change 
}

void f() {
  B b;
  auto x = b.x; // OK
  auto [y] = b; // Allowed by this change

This change also allows to class access its own data members through structured bindings:

class C {
  int x;
  void f(const C & c) {
    auto [x] = c; // Allowed by this change
  }
}

Note that this has been approved for C++20, but has been also marked as a defect report for C++17.

Relaxing the structured bindings customization point finding rules

This change solves another problem with structured bindings and the get() function that affects to classes that have a non templated get() member function. Note that this is the case of smart pointers.

With this change “if a member get() is found, it must be a member template to be used with a structured binding. If a get() that is not a template is found, that member is not used, and the lookup continues to try and find an ADL get<>().

Down with typename!

You may have got tired of writing typename in places where you think the compiler could do it for you. Have you been there?

Let me show an example from the new text in the standard:

template<class T> T::R f(); // OK, return type of a function declaration at global scope

template<class T> void f(T::R); // Ill-formed (no diagnostic required), attempt to declare a void variable template

template<class T> struct S {
  using Ptr = PtrTraits<T>::Ptr; // OK, in a defining-type-id
  T::R f(T::P p) { // OK, class scope
    return static_cast<T::R>(p); // OK, type-id of a static_cast
  }
  auto g() -> S<T*>::Ptr;  // OK, trailing-return-type
};

template<typename T> void f() {
  void (*pf)(T::X); // Variable pf of type void* initialized with T::X
  void g(T::X); // Error: T::X at block scope does not denote a type
                // (attempt to declare a void variable)
}

Allow pack expansion in lambda init-capture

You may have wanted to pass a variadic argument to lambda by capturing it by move. Now you can!

template <typename ... Args>
void f(Args ... args) {
  auto f = [...x = std::move(args)]() { return g(x...); };
  f();
}

Attributes for likely and unlikely

This is something that different compilers have been doing in a non-portable way. You can now mark which branch is likely to be executed to give that information to your optimizer.

if (a>b) [[likely]] {
  do_something();
}
else {
  do_other();
}

You can also optimize the common case in nested branches:

if (a>b) {
  if (c>d) [[likely]] {
    do_something();
  }
}

Or tell the compiler that a loop usually is not executed:

while (a>0) {
  [[unlikely]] g();
}

Or mark the most common case in a switch:

switch (x) {
  case one:
    f();
    break;
  case two:
    [[likely]] g();
    break;
  default:
    h();
}

Adding symmetry to operator <=> (aka spaceship operator)

You may be aware of operator<=> which allows you to define a single operator for all comparisons in a class.

Currently, if the language finds an expression like b<a (where b and a may be of different types), the following operations are matched:

  1. operator<(b,a) and b.operator<(a)
  2. operator<=>(b,a) < 0 and b.operator<=>(a) < 0
  3. 0 < operator<=>(a,b) and 0 < a.operator<=>(b)

This allows to provide a single definition of operator<=>. However, if the language finds an expression like b<=>a (even if a<=>b exists), this rule doesn’t apply. This can be seen as a lack of symmetry for operator <=> which has been corrected now.

C++20 library

A <version> header

This is a new header file with implementation-dependent version information. Just to clarify the information that you may find there might be different in each implementation and it will be related to your own vendor. Consequently, you do not need to go there to get any standard information.

In fact, there is no standard symbol defined in that header.

Comparing Unordered Containers

Current comparison of unordered containers is undefined unless Hash and Pred have exactly the same behavior for both containers. This implies that to different hash functions (for example, using different seeds) might lead to containers being different.

Hash has now being removed from the undefined behavior definition.

Extending <chrono> to Calendars and Time Zones

This is (to my view) a very important component of C++20 standard library. I am not going into details here as you may have a look to an implementation at https://github.com/HowardHinnant/date.

string::reserve Should Not Shrink

Until C++17 std::reserve(sz) might reallocate if the new size is smaller than the capacity. This brings a number of problems:

  • It may be a performance penalty.
  • It may cause portability problems.
  • Is inconsistent with behavior of std::vector.
  • Complicates generic code that wants to handle uniformly vector and string.

In C++20 std::reserve(sz) will never perform a shrink_to_fit(sz).

Thou Shalt Not Specialize std Function Templates!

Specializing entities from std has been strongly restricted:

  • Specializing function templates from the std namespace is not allowed.
  • Taking the address of a standard library function is not allowed.

Manipulators for C++ Synchronized Buffered Ostream

Three new manipulators have been added to be used with synchronized ostreams (basic_osyncstream):

  • emit_on_flush: Makes flushes to apply immediately.
  • noemit_on_flush: Make flushes to be postponed until an emit.
  • flush_emit: Flush all remaining information.

span: bounds-safe views for sequences of objects

Class span offers a view over a sequence that may live in an array or vector, but does not own such elements. Consequently, span does not perform any memory allocation or deallocation.

void f(span<int> s) {
  //...
}

void g() {
  int v[100];
  span<int,100> s{v};
  f(s);
}

Constexpr iterator requirements

Defines the concept of a constexpr iterator, which is an iterator whose operations are constexpr. This will allow that those containers providing constexpr iterators (e.g. std::array) may be used in constexpr functions.

Publicado en cpp-posts, misc, Sin categoría, Trip Reports

Report from using std::cpp 2017

Note: We publish this report in English as some information might be interesting for a broader audience.

Last November, 30th we had the 5th edition of using std::cpp (the annual C++ conference in Spain). The conference is a one-day free event held every year at University Carlos III of Madrid, in the Higher Polytechnic School in Leganés.

Again, we had around 200 attendees, being most of them profesional developers from industry.

Who attended using std::cpp 2017?

Around 65% of attendees where coming from the Madrid region. However, more than 30% of people came from many other areas in Spain (some of them requiring to travel 400-500 Km).

We used the evaluation forms to get some information that might be of general interest for the C++ community.

First thing we asked was the king of attendee. 90% of them were from industry, 6.7% were academics and we had only 3.3% students. While we are getting a lot of interest in local industry we understand that we must increase our efforts to attract students to the conference.

We tried to better understand what our professional developers are doing:

  • 91.3% answered they use C++ in their daily job.
  • We tried to understand which versions of the C++ standard they are using. People could make multiple choice to this question. Compared to the answers in 2016 we found that the use of C++11 is stable (74%). However use of C++98/03 is decreasing (46.8% now versus 68% one year ago) and C++14 is increasing (39.2% now versus 21% one year ago). We thought it was premature to ask about C++ 17 this time. However, 8.9% answered they were using some C++ TS, versus 0% one year ago.
  • We also asked about the compilers people were using. GCC got 78.8% (60% one year ago), Microsoft got 51.2% (was 57% previous year), clang++ got 35% (14% one year ago), Intel C++ got 7.5% (1.8% one year ago). We even had one person using Embarcadero C++ and 2 people using Sun Oracle C++.
  • Most popular platforms were GNU/Linux 75% (57.1 previous year), Windows 61.3% (67.9% last year), MacOS 18.8% (8.95 last year), Android 13.8% (5.4% last year), Solaris 11.3% (3.6% last year) and iOS 7.5% (1.8% last year). Besides that, we also had some individuals working on Arduino, embedded processors, Raspberry Pi, ARM and videoconsoles.

Note that this statistics do not mean that we detected any significant trend and might well be derived in a change of our audience.

We also tried to segment our audience by industry:

  • Telco: 17.5%
  • Aeroespace/Air traffic: 13.8%
  • Videogames: 8.8%
  • Developer tools: 8.8%
  • Finance: 7.5%
  • Security: 6.3%
  • Healthcare: 5%
  • Civil engineering: 5%
  • Consumer electronics: 3.7%
  • Defense: 3.5%
  • Energy: 2.5%
  • Banking: 2.5%
  • Transport: 2.5%
  • Internet of the Things: 2.5%
  • Naval: 2%
  • Manufacturing: 1.2%
  • Robotics: 1.2%
  • Research and Development: 1.2%

As you may see C++ is locally used in many different sectors.

Our talks in 2017

Here is summary of the talks we had this year. Although all talks were given in Spanish several presenters provided slides in English. Even a couple of them came for the event from other countries were they currently work.

If your interested in the videos (in Spanish) you may access all of them here.

  • Opening: We had a short opening where a key point was the general congratulation to Bjarne Stroustrup for getting the Faraday Medal. We even showed a short video that was filmed by the IET about Bjarne’s work.
  • An Intro to Boost.PolyCollection: Joaquín M. López (independent developer and a contributor to several Boost libraries) presented his latest development: a polymorphic container.
  • Why you must NOT use conan: Diego R. Losada (co-author fo the Conan package manager) gave a short presentation trying to convince us not to use its own product. Or was it the other way round? In fact, he gave a good response to every complain about Conan as a C++ package manager.
  • Look that sequence… Is it a vector? Is it a list? No! It’s a super-tree!: Marin Knoblauch (Indizen Technologies) gave a talk about trade-offs between linked lists and vectors and approaches using some kinds of trees.
  • Introducing Qt Programming: Jesús Fernández (Qt Company) travelling from Finland where he lives and works, introduced Qt for C++ programmers highlighting its current state.
  • C++17 Vocabulary Types: Again Joaquin M. López, gave a short talk about main vocabulary types in C++17 and why we should be using them.
  • CppCoreGuidelines part 1: Introduction and Philosophy: Juanmi Huertas (HP) came from Barcelona to convince people why they should be following advices from CppCoreGuidelines. He focused on some general principles and gave hints.
  • The Hourglass Pattern: David Rodríguez-Ibeas (Blommberg) came from London to presente the Hourglass pattern. If you have to handle with dynamic libraries in C++ this is the pattern you want to apply.
  • GrPPI: Simplifying parallel design patterns: J. Daniel Garcia (ARCOSLab, University Carlos III) presented GrPPI (Generic Reusable Parallel Patterns Interface) an effort to provide a set of common patters trying to simplify parallel programming while making use of multiple back-ends.
  • Name Lookup, simple: David Rodríguez-Ibeas (Bloomberg) gave a short talk trying to explain and clarify name lookup rules in C++.
  • IncludeOS: Experimenting with an unikernel in C++: Jesús Martínez (University of Malaga) presented his experience using includeOS in practice.
  • Coroutines: Past, present and future: Manu Sáncez (ByTech) gave a good overview about coroutines and its usefulness for real applications.
  • Using use cases for application design in C++: Victor Merino (TOOL) explained his approach for designing applications in C++ that need to be maintained in the long run with use cases and DCI.
  • How to save the world while programming? 7 tips on sparing CPU cycles: Juanmi Huertas (HP) came back on stage to give practical tips on how we can get better performance in our applications, or how to avoid spoiling them.

After going through the evaluation forms the best presentation award goes (again) to Joaquin M. López for his talk An Intro to Boost.PolyCollection. Congratulations, Joaquin!

Acknowledgements

We want to thank many people who helped to make using std::cpp again a reality. First of all, we want to thank to every attendee that came to visit us for a full day around C++. We hope they got what they expected.

Our thanks go to Indizen and JFrog Conan for helping us with the organization of the event and taking care of coffe-breaks.

We also want to express our gratitude to JetBrains. Again this year they have contributed by giving a number of licenses of CLion that we have given out in a draw.

Of course, we also want to express our thanks to all the speakers in this year’s edition. They were crucial in attracting the audience and all the talks were highly evaluated by attendees.  Additional thanks to those speakers that had to travel to give the talks. We hope that the effort all of them put in preparing their talks was worth.

Finally, we want to thank to the volunteers who helped in the organization.

Publicado en eventos, Lenguaje C++, misc, Trip Reports