« first day (1490 days earlier)      last day (1363 days later) » 

1:01 AM
@domocar1 Yes. Essentially any reinterpret_cast just tells the compiler to view some existing storage as if it contained the specified type.
 
 
7 hours later…
7:53 AM
There seems to be an error that's happenning with gcc 9 only.
template <class T, bool SHARE_LOCATION, bool VARIANCE_ENCODED_IN_TARGET, bool CORNER_TRUE_CENTER_FALSE, bool CLIP_BBOX> static
void launch_decode_boxes_kernel(const Stream& stream, Span<T> decoded_bboxes, View<T> locations, View<T> priors,
    bool transpose_location, bool normalized_bbox,
    size_type num_loc_classes, index_type background_class_id,
    float clip_width, float clip_height)
{
    auto kernel = raw::decode_bbox<T, SHARE_LOCATION, VARIANCE_ENCODED_IN_TARGET, CORNER_TRUE_CENTER_FALSE, CLIP_BBOX>;
error: narrowing conversion of ‘8’ from ‘long unsigned int’ to ‘bool’ [-Wnarrowing]
  687 |         launch_decode_boxes_kernel<T, current & 8, current & 4, current & 2, current & 1>(std::forward<Args>(args)...);
note: template argument deduction/substitution failed:
The template parameters are all bool but I am passing an integer (current & 8 results in an integer which is converted to bool). It was working in previous versions of gcc.
Is gcc 9 correct about the error?
 
8:06 AM
TLDR: g++ threw an error for implicitly converting an std::size_t & int to bool in a template argument. Is the compiler correct?
Oh wait, the compiler is complaining that the int is being converted to bool. It's worried about the rhs operand of the & operator instead of the whole expression.
/home/yashas/Desktop/opencv/opencv4/modules/dnn/src/cuda/detection_output.cu:666:1: note:   template argument deduction/substitution failed:
/home/yashas/Desktop/opencv/opencv4/modules/dnn/src/cuda/detection_output.cu:687:92: error: narrowing conversion of ‘8’ from ‘unsigned int’ to ‘bool’ [-Wnarrowing]
  687 |         launch_decode_boxes_kernel<T, (current & 8), (current & 4), (current & 2), (current & 1)>(std::forward<Args>(args)...);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
2 hours later…
10:35 AM
Date::Date(int dd)
:d{dd}
{
// check that the Date is valid
}
will d{dd} be evaluated before {//Check that the Date is valid}
?
 
 
3 hours later…
1:38 PM
@beta_meme_beta yes
The order is this: first the d object is initialized based on dd and afterwards, the block of code between the curly brackets is evaluated.
 

« first day (1490 days earlier)      last day (1363 days later) »