Replies: 5 comments
-
|
I was thinking about moving vocab preprocessor definitions to |
Beta Was this translation helpful? Give feedback.
-
|
First step: #1764 |
Beta Was this translation helpful? Give feedback.
-
|
After merging #1764 the next step is to change all the in |
Beta Was this translation helpful? Give feedback.
-
|
I suggest to add in namespace yarp {
namespace conf {
// [...]
typedef std::int32_t vocab32_t
}
}and to return This will allow us (one day) to change easily from signed to unsigned and will also save us from big issues in case, one day, we wanted to to have a 64 bit vocab |
Beta Was this translation helpful? Give feedback.
-
|
I noticed reviewing #1924 that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We could replace all the
defines around yarp with constexpr, but more important we can use theconstexprfunctions.The
constexprfunctions has the limitation of that they have to have only onereturnstatement and they have to handle data that is defined compile time.The
constexprvariables and functions are defined compiled time and put in read-only memory.More computation we move from the run-time to the compilation more the code will run faster!
For example functions of conversion between measurement units should be constexpr.
Beta Was this translation helpful? Give feedback.
All reactions