将boost的bufferstream转换为istream

时间:2018-02-20 09:53:07

标签: c++ boost istream boost-interprocess

是否可以将boost的bufferstream转换为istream?我正在尝试进行转换,但是我仍然不清楚我是在做错事还是根本不可能做到这一点。我很感激任何答案。

char *copy = static_cast <char*> (region.get_address());
for (int i = 0;i < length;i++) copy[i] = str[i];
bufferstream input_stream (copy, length);

然后我需要将bufferstream转换为istream。 基本上,我需要将bufferstream实例作为参数传递给接受istream&amp;的函数。

1 个答案:

答案 0 :(得分:1)

目前还不清楚你想要实现的 ¹,这是我最好的猜测:

<强> Live² On Coliru

$data = array_walk($request->all(), function (&$a, $b) { $a = encrypt($b); });
$encryptedData = $this->Ipr_type->create($data);

¹https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem

²Coliru

不支持共享内存