Skip to content

Utility functions to transform enum to string and back. #102

Closed
@diptorupd

Description

@diptorupd

Looks like a duplication. I see this code above. It is better to create function which transforms enum to string and back.

Originally posted by @PokhodenkoSA in #93 (comment)

Example code:

case info::device_type::cpu:

case info::device_type::cpu:

Both examples contain conversion from enum to string. It is a code duplication and could be refactored into single function.
Also it is a good design to create pairs of functions to convert enum to string and string to enum.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions