git.fiddlerwoaroof.com
Greg Wiley authored on 04/05/2017 18:18:54
Showing 2 changed files
... ...
@@ -19,6 +19,9 @@ namespace
19 19
 class impl : public stdlib_ifc
20 20
 {
21 21
 public:
22
+    void srand(unsigned int seed) const override {
23
+        ::srand(seed);
24
+    }
22 25
     int rand() const override
23 26
     {
24 27
         return ::rand();
... ...
@@ -17,6 +17,8 @@
17 17
 class stdlib_ifc
18 18
 {
19 19
 public:
20
+    virtual void srand(unsigned int seed) const {
21
+    }
20 22
     virtual int rand() const
21 23
     {
22 24
         return 0;
... ...
@@ -32,6 +34,9 @@ private:
32 34
 public:
33 35
     stdlib (delegate delegate = std::make_shared<stdlib_ifc>()) : delegate_
34 36
         (delegate) {}
37
+    void srand(unsigned int seed) const {
38
+        return delegate_->srand(seed);
39
+    }
35 40
     int rand() const
36 41
     {
37 42
         return delegate_->rand();