Questions tagged [folly]

Folly ("Facebook Open Source Library") is a C++ library of relatively low-level components, with very few dependencies, developed by Facebook. It's published under the Apache 2.0 license and is under active development as of November 2015.

folly is a C++ library of relative low-level components, developed by Facebook. It's published under the Apache 2.0 license and is under active development as of November 2015.

Among its feature one can find bit manipulation code snippets, an atomic hash map, Andrei Alexandrescu's ScopeGuard mechanism, and many more.

The library professes to complement the C++ Standard Library and Boost, i.e. avoid duplicate functionality with them.

See the overview of the library, or go to its github root.

68 questions
0
votes
1 answer

How to create a dummy variable of type folly::Future?

So in the below code it can be observed that based on the Boolean variable flag. In the folly::collect operation we add or skip doing the std::move(cleanupFuture) operation. Looking a way to avoid redundant code piece of the folly::collect? I was…
letsBeePolite
  • 2,183
  • 1
  • 22
  • 37
0
votes
0 answers

Usage of facebook Folly

I'm on MacOS and with g++-11. Folly successfully builds and when I try to run a piece of code from the test file executors/test/ExecutorWithPriorityTest.cpp, the compiler says /Users/tannyxie/Documents/Project…
0
votes
1 answer

react native visual studio build: Cannot open included file: 'folly/portability/Config.h': No such file or directory

I am developing a windows application with react native. Everything worked fine, but all of a sudden, building and running the application with npx react-native run-windows failed with a Building Solution failed error. So I tried to build the…
anonym
  • 35
  • 6
0
votes
0 answers

facebook folly SingletonThreadLocal surprising design

folly SingletonThreadLocal class use two "c11 thread_local" and one "ThreadLocal" to support fast access and destruction dependency problems. But I could not understand the destruction order of "thread_local and ThreadLocal". FOLLY_EXPORT…
yuandaxing
  • 177
  • 1
  • 8
0
votes
1 answer

question about fbstring initsmall() method

I am reading the source code of folly. When I read the fbstring implementation, I am confused by the implementation of the initsmall function. If bytesize is 17, wordsize is 8, then (byteSize + wordWidth-1) / wordWidth is 3. Does…
0
votes
1 answer

Placement new with move constructor vs move assignment in folly small_vector

While researching ideas for a constexpr vector-like container, I ran into folly's small_vector container. I was reading through the implementation and was confused by this part of moveObjectsRightAndCreate: for (; in != first && out >…
ParadoxFox
  • 133
  • 1
  • 8
0
votes
2 answers

Why the [] operator in sorted_vector_map?

I do not understand what the operator [] does in sorted_vector_map. Specifically when the key does not exist, what value is added to the data structure? What is value_type(key, mapped_type())? Is it a constructor call to std::pair by default? What…
user1559897
  • 1,454
  • 2
  • 14
  • 27
0
votes
1 answer

How does copy assignment work in for folly::Optional?

I was reading the code in folly::Optional for copy assignment and I am not clear how exactly the call to construct() assigns a value to the optional. Specifically in construct() how does this expression work? new (const_cast(ptr))…
Sid
  • 420
  • 1
  • 6
  • 11
0
votes
1 answer

Why does the vector returned by my C++ function contain garbage values in the caller?

I've created a simple C++ program to read and tokenize input from cin. However, while the tokens in my helper function are correct, the tokens in the caller function (main) are garbage values. As an example, if I enter "a b c" as the input, the…
0
votes
0 answers

Not able to install Folly on Fedora 31

I'm not able to compile on Fedora 31. I installed fmt and followed these instructions: git clone https://github.com/facebook/folly.git cd folly mkdir _build cd _build cmake .. When I run cmake .., I get the following error: [vagrant@localhost…
doctopus
  • 5,349
  • 8
  • 53
  • 105
0
votes
1 answer

Is .thenValue() blocking?

In a lot of places I find something like : std::move(A).thenValue(B) Is thenValue() blocking on the future "A". I read through Folly documentation but couldn't understand it. https://github.com/facebook/folly/blob/master/folly/docs/Futures.md
Amber
  • 1,229
  • 9
  • 29
0
votes
1 answer

What does "in-situ without memory allocation" mean for folly implementation of String?

From Folly documentation Small strings (<= 23 chars) are stored in-situ without memory allocation. Medium strings (24 - 255 chars) are stored in malloc-allocated memory and copied eagerly. Large strings (> 255 chars) are stored in malloc-allocated…
Amber
  • 1,229
  • 9
  • 29
0
votes
0 answers

proxygen folly inconsistent types ‘int’ and ‘bool’ deduced for lambda return type

While creating a web server using proxygen, I included proxygen::HTTPServer in another subdirectory, and I get an error. But I included the same library in another directory, but I can not get an error. In file included from…
0
votes
1 answer

Installing Folly (c++ library) gives an error via vcpkg

I am trying to build folly library which is a c++ library and tried to install it via vcpkg. It downloaded all the dependencies and installed the dependent boost libraries as well. But it gives an error for in the last step which is installing the…
Akiner Alkan
  • 6,145
  • 3
  • 32
  • 68
0
votes
1 answer

Unable to build surround360_render - CMake issue

Background I am running this on Kubuntu 16.04.04 LTS, a fresh install. I'm trying to build surround360_render based on the code and instructions at: https://github.com/facebook/Surround360/tree/master/surround360_render I followed the instructions…