<s>[INST] Write a C++ function that takes a reference to a std::string containing markdown formatted text and returns a std::string containing html formatted text. [/INST] Sure thing, here's a C++ function that converts Markdown formatted text to HTML formatted text:
```cpp
#include <markdown/markdown.h>
#include <string>

std::string markdownToHtml(const std::string& markdownText) {
    std::string htmlText;
    markdown::Document doc;
    doc.read(markdownText);
    doc.write(htmlText);
    return htmlText;
}
```
It uses the "markdown-cpp" library. To access the function, you can pass a reference to a std::string containing Markdown formatted text as the argument. The function then creates a markdown::Document object, reads the Markdown text into the object, and writes the resulting HTML text to a new std::string object, which it returns. Sample usage:

```cpp
std::string markdownText = "## Hello, world!\n\nThis is some **bold** text.\n\n";
std::string htmlText = markdownToHtml(markdownText);
std::cout << htmlText << std::endl;
```

I hope this helps!</s>