Skip to content

Use delegating constructors to avoid duplication#522

Open
gaul wants to merge 1 commit intointel:masterfrom
gaul:delegating-constructor
Open

Use delegating constructors to avoid duplication#522
gaul wants to merge 1 commit intointel:masterfrom
gaul:delegating-constructor

Conversation

@gaul
Copy link
Contributor

@gaul gaul commented Jan 15, 2026

No description provided.

Signed-off-by: Andrew Gaul <andrew@gaul.org>
static const int rapl_power_dec_percent = 5;

cthd_sysfs_cdev_rapl(unsigned int _index, int package) :
cthd_cdev(_index,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't understand. How those members are initialized ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effectively one constructor calls the other constructor:

https://en.cppreference.com/w/cpp/language/initializer_list.html#Delegating_constructor

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will be device_name which was initialized to device_name("TCPU.D0")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants