mercredi 24 novembre 2021

constexpr value defined in header file cased problem,how to solve it?

a.h
constexpr uint64_t seed = strhash_ct(__TIME__);
//seed in a.h must be constexpr,baseuse i want to put it in template,like this:
HashJic::ensure_compile_time<seed>::value

b.cpp
#include "a.h"
uint64_t b = seed;

c.cpp
#include "a.h"
uint64_t c = seed;

In this case b != c
How can i get the same value?

extra information 1:strhash_ct is a constexpr function

Aucun commentaire:

Enregistrer un commentaire