Fix Random-inl.h under MSVC
authorOrvid King <blah38621@gmail.com>
Wed, 29 Jul 2015 17:45:41 +0000 (10:45 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Wed, 29 Jul 2015 18:22:14 +0000 (11:22 -0700)
Summary: With MSVC, `seedData.begin()` does not return a `void*`, so get a pointer to the data, and explicitly cast that to a `void*` instead.
Closes #251

Reviewed By: @yfeldblum

Differential Revision: D2282929

Pulled By: @sgolemon

folly/Random-inl.h

index c776338..10da8d3 100644 (file)
@@ -107,7 +107,7 @@ StateSize<std::subtract_with_carry_engine<UIntType, w, s, r>>::value;
 template <class RNG>
 struct SeedData {
   SeedData() {
-    Random::secureRandom(seedData.begin(), seedData.size() * sizeof(uint32_t));
+    Random::secureRandom(seedData.data(), seedData.size() * sizeof(uint32_t));
   }
 
   static constexpr size_t stateSize = StateSize<RNG>::value;