namespace Msp {
namespace IO {
-Memory::Memory(char *b, char *e, Mode m)
+Memory::Memory(char *d, std::size_t s, Mode m):
+ Memory(d, d+s, m)
+{ }
+
+Memory::Memory(char *b, char *e, Mode m):
+ begin(b),
+ end(e),
+ pos(begin)
{
- begin = b;
- end = e;
- pos = begin;
mode = m;
}
+Memory::Memory(const char *d, std::size_t s):
+ Memory(const_cast<char *>(d), const_cast<char *>(d+s), M_READ)
+{ }
+
+Memory::Memory(const char *b, const char *e):
+ Memory(const_cast<char *>(b), const_cast<char *>(e), M_READ)
+{ }
+
void Memory::set_block(bool)
{
throw unsupported("Memory::set_block");
char *pos = nullptr;
public:
- Memory(char *d, std::size_t s, Mode m = M_RDWR): Memory(d, d+s, m) { }
+ Memory(char *d, std::size_t s, Mode m = M_RDWR);
Memory(char *, char *, Mode = M_RDWR);
- Memory(const char *d, std::size_t s): Memory(const_cast<char *>(d), const_cast<char *>(d+s), M_READ) { }
- Memory(const char *b, const char *e): Memory(const_cast<char *>(b), const_cast<char *>(e), M_READ) { }
+ Memory(const char *d, std::size_t s);
+ Memory(const char *b, const char *e);
void set_block(bool) override;
void set_inherit(bool) override;