Skip to content

libPMacc unclear syntax and missing documentation

n01r edited this page Sep 25, 2014 · 2 revisions

This is a list of unclear or missing documentation in libPMacc.

PMACC_AUTO

#define PMACC_AUTO(var,...) BOOST_AUTO(var,(__VA_ARGS__))

What it does:
It emulates the auto specifier that deduces the type of a variable by its initialization.

Why it looks like that:
The keyword auto is only available since C++11. BOOST_AUTO does exactly that and PMACC_AUTO is the PIConGPU-internal implementation.

Syntax:

  • first argument: variable name that you want to use
  • second argument: initialization

Usage of [...] brackets
What do they do exactly and when are they used?
The box brackets enable access to particle attributes of particles stored in frames. Due to the fact that those attributes are initialized by <attribute>_ instead of <attribute>() the access to them had to be redefined.