Category : abseil

Tried to install as per grpc quickstart page. Installation of gRPC itself was fine but third-party/abseil-cpp is giving lot of errors ("make -j" step): #error "C++ versions less than C++11 are not supported." /home/guest/grpc/grpc-cpp/grpc/third_party/abseil-cpp/absl/base/config.h:108:15: error: static_assert expression is not an integral constant expression /home/guest/grpc/grpc-cpp/grpc/third_party/abseil-cpp/absl/base/policy_checks.h:77:2: error: "C++ versions less than C++11 are not supported." #error "C++ ..

Read more

I am building a C++ project that uses gRPC. The layout of the source code is basically /protos foo.proto /includes *.h /src client.cpp server.cpp CMakeLists.txt To generate my cpp and gRPC files I’m using the protobuf_generate CMake function like find_package(Protobuf CONFIG REQUIRED) find_package(gRPC CONFIG REQUIRED) add_library(foo ${proto_files}) target_link_libraries(foo PUBLIC protobuf::libprotobuf gRPC::grpc++ ) then protobuf_generate( TARGET ..

Read more

I cannot build abseil-cpp with Bazel. I’m building it directly on arm64. Device: NVIDIA Jetson Xavier NX OS: Ubuntu 18.04 CPU: 6-core NVIDIA Carmel ARM®v8.2 64-bit ./example/hello_world.cc #include <iostream> #include <string> #include <vector> #include "absl/strings/str_join.h" #include "absl/random/random.h" int main() { std::vector<std::string> v = {"foo", "bar", "baz"}; std::string s = absl::StrJoin(v, "-"); absl::BitGen bitgen; std::cout << ..

Read more

I tried to use abseil’s string library, but already the simple example does not run and fails with terminate called after throwing an instance of ‘std::bad_alloc’. The snippet I use #include "absl/strings/str_cat.h" #include "fmt/core.h" int main(){ auto s1 = absl::StrCat("A string ", " another string", "yet another string"); fmt::print( "{}n", s1); } I use Abseil ..

Read more

i use google test and google mock. There is a mock object on which i expect a method call OnConnectionError() which notifies the absl::Notification object done 3 times. absl::Notification done; EXPECT_CALL(*client, OnConnectionError(::testing::_)).Times(3) .WillRepeatedly(Notify(&done)); bool result = client->ConnectToServer("localhost", 5000, 2); done.WaitForNotificationWithTimeout(absl::Duration(absl::Seconds(30))); The method client->ConnectToServer has a loop which results in the repetitive call of OnConnectionError, which ..

Read more

The pattern from <random> is the standard design for a modern C++ approach to sample from univariate distributions, which is also adapted in Boost-Random and abseil. Major benefits of this pattern seem to be Orthogonal implementation of the distribution and the uniform random bit generator. Standardized layout shared by all distribution. Is there a library ..

Read more

I’m trying to use some functions from ABSEIL random with Cmake. (like absl::Uniform()) I made all like in this instruction. And all work. Then i want more and started to test absl::Uniform(). ABSEIL RANDOM My hello_word.cc is like #include <iostream> #include <string> #include <vector> #include "absl/strings/str_join.h" #include "absl/random/random.h" int main() { std::vector<std::string> v = {"foo","bar","baz"}; ..

Read more

I’m trying to create a absl::flat_hash_set of folly::small_vector. The documentation for adding support for a custom type for absl::Hash says: An AbslHashValue overload for a type should only be declared in the same file and namespace as said type. The proper AbslHashValue implementation for a given type will be discovered via ADL. Unfortunately I can’t ..

Read more