class File
  // Descriptive fields
  string name;
  string id;
  string uploader_id;

  // ----Comparable fields----
  uint   downloads;  // 40% importance
  uint   size_in_bytes;  // 20% importance
  time_t time_millisec_created;  // 20% importance
  time_t time_millisec_last_used;  // 20% importance

In an array of such File objects, I want to find out an element from an array, which is delete-able. This element can be decided based on the "Comparable fields" mentioned above. Lower the value, it's more delete-able.

Now, I can't make a simple comparator operator due to complexity involved of percentage value.

What is a reasonable & rational way of comparing 2 such File objects?

New contributor
iammilind is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

put on hold as off-topic by dkaeae, Yuval Filmus, Evil, xskxzr, David Richerby Aug 14 at 13:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about software development or programming tools are off-topic here, but can be asked on Stack Overflow." – dkaeae, Yuval Filmus, Evil, xskxzr
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Although this is written with explicit code and mentions C++, I don't think it's a programming question. Rather, it's asking for a method of comparing multidimensional data. However, I think there are big problems with the question. First, it's under-specified: I can't tell what sort of comparison is wanted or what context it will be used in. Second, I don't see what the percentage importance values are supposed to mean: how do you compare the importance of being 10kb smaller with the importance of being 10s older? Third, what is "reasonable and rational" is pretty much a matter of opinion. $\endgroup$ – David Richerby Aug 14 at 13:16
  • $\begingroup$ I'm voting to close as unclear but, because of the way Stack Exchange works, it'll look like I contradicted myself by voting to close as a programming question. $\endgroup$ – David Richerby Aug 14 at 13:16