|
How can I cast a boost::shared_array<char> to boost::shared_array<const char> ?
Started by Joakim Karlsson on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
The internals of the class with const-qualified template parameter may differ dramatically from... .
Such compiler-generated casting can not be possible.
As both types are based on a template, both types are completely different for the compiler .
You can't.
|
|
Let's say I have a drive such as "C:\", and I want to find out if it's shared and what it's share name (e.g. "C$") is.
To find out if it's shared, I can use NetShareCheck .
How do I then map the drive to its share name? I thought that NetShareGetInfo ...
Started by MOE37x3 on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
I'm not sure : WNetGetConnection will give you the path associated with a mapped network drive, but not the share.
SHGetFileInfo with SHGFI_ATTRIBUTES
upon return check the dwAttributes flag for SFGAO_SHARE.
|
|
Hello
How to convert shared_ptr that points to const object to shared_ptr that point to nonconst object. I am trying to do the following :
boost::shared_ptr<const A> Ckk(new A(4)); boost::shared_ptr<A> kk=const_cast< boost::shared_ptr<...
Answer Snippets (Read the full thread at stackoverflow):
The proper way should be this
boost::shared_ptr<A> kk (boost::const_pointer_cast<A>(Ckk));
'boost::const_pointer_cast' will do what you're asking for, but the obligatory second half of....
Use boost::const_pointer_cast , documentation.
|
Ask your Facebook Friends
|
I am trying to get Symantec Endpoint Protection working (trial). I have succeeded but found that on the windows xp machines I need to turn off simple file sharing and share admin$ and c$ as admin shares. Is there a clever way of automating these settings...
Started by JohnyV on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at serverfault):
If the logon user must be a local admin then you can do .
If that will work with the C$ share.
|
|
Are there any downsides with using make_shared<T>() instead of using shared_ptr<T>(new T) .
Boost documentation states
There have been repeated requests from users for a factory function that creates an object of a given type and returns a...
Started by Tobbe on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
That means your shared....
I don't know why this isn't supported, but it isn't .
No custom deleter.
Not a big one really, but some older api's like to return pointers that you must delete .
You must be in control of the allocation.
I know of at least two.
|
|
Boost::shared_ptr has an unusual constructor
template<class Y> shared_ptr(shared_ptr<Y> const & r, T * p);
and I am a little puzzled as to what this would be useful for. Basically it shares ownership with r , but .get() will return p . not...
Started by Evan Teran on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
It is optimization.
It is useful when you want to share a class member and an instance of the class is already a shared A ); shared_ptr<int> b( a, a->B );
they share the use count and stuff.
|
|
I am developing a shared library(.so) and dll. I have a global variable which is updated in multiple threads. So I have mutex lock for synchronization.
I am not clear whether global data in shared library is shared across process. If it is then I need...
Started by Andy on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You can find more information on MSDN in the article titled " How do I share data in my DLL with an application or with other DLLs.
Segment (data_seg) in order to share global variables across processes.
|
|
I'm a bit stumpped on this one.
I created a security group in AD called "special data users" and add myself to it.
I then created a share on a server and give that AD security group full access to the share.
If i try to access the share I cannot and get...
Started by AlanBarber on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at serverfault):
I recommend you setup share permissions as follows to avoid confusion:
On the share permissions themselves....
Make sure that you've assigned read permissions once you added user to a new group .
And see if that account can access the share.
|
|
Hi, I have several Installshield 12 setups (using non-msi Installscript based setups) for several different products. These share some code, which I would like to put into shared .rul files. However, some of that code can report errors or in general show...
Started by Legolas on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
If you've got more than a couple languages, you'll probably want to do this as an automation script to avoid driving yourself crazy .
You can export and import the string tables in either the General Information view or via the automation interface .
|
|
Is it possible to share a single 'god' instance among everyone that links to this code, to be placed in a shared object?
god* _god = NULL; extern "C" { int set_log_level(int level) { if(_god == NULL) return -1; _stb->log_level(level); return 0; } int...
Started by Edu Felipe on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Across actual processes, you.
@grieve is referring to a global accessed by multiple threads, but threads share the same parent process instance.
Be able to share the values across running programs.
|