Open JasonRuonanWang opened 2 years ago
@qliu21, please hold off on merging this until we discuss it at a Tuesday meeting. This issue has come up in my rewrite of the Huffman compression code.
@JasonRuonanWang, were you getting a build error? Are std::int64_t
and long int
not the same type on your architecture?
Are
std::int64_t
andlong int
not the same type on your architecture?
See this error encountered in #189.
Apple clang thinks they're different types. This code
#include <cstdint>
#include <iostream>
template <typename T>
bool is_int64() { return std::is_same<T, std::int64_t>(); }
int main()
{
std::cout << "int: " << is_int64<int>() << std::endl;
std::cout << "int64_t: " << is_int64<int64_t>() << std::endl;
std::cout << "long int: " << is_int64<long int>() << std::endl;
std::cout << "long long int: " << is_int64<long long int>() << std::endl;
return 0;
}
outputs
int: 0
int64_t: 1
long int: 0
long long int: 1
long
and long long
have the same size and representation but are distinct types.
This was broken on Mac with mgard_x serial option enabled.